Implementing interfaces and packages part deux

Ok, I've been reading some more posts, and it seems like a lot of people have the same issues as I have right now.
One suggestion that i read was to go into the directory that is the package name.
That is if everything is in package Grid, then go into ./src/Grid directory and then do a javac *.java
when I do that, all my code, even the one that implements an interface will compile. But when I don't do *.java within the /Grid directory, and lets say I am in the ./src directy and I do a javac Grid.Cell (where Cell is the class name), the program will not compile. Why is that...I haven't found a good answer as to why this isn't working yet. Please please help.

I wont get into your directory structure bcz its makin me dizzy..
hopefully it is ok.
can you see a difference between these 2 lines that you say you have tried:
javac *.java <<<< u said compiles
javac Grid.Cell <<<< u said doesnt compile
Two things come to mind:
1.javac needs the .java extension to compile
2.you need to be IN the directory where the source is to compile
k?
try it...

Similar Messages

  • Include only interfaces and package-level comments -

    hi jd forum -
    forgive if this is covered elsewhere. i've found references to -include, -exclude, and 'docset', but i can't find these in the documentation at http://java.sun.com/j2se/1.3/docs/tooldocs/win32/javadoc.html (maybe it's for a different version).
    i want to only include documentation for interfaces and exclude the classes -- and / or include documentation on a filename basis -- like 'document only IBI*.java.' also, i want to include ONLY package-level documentation (package.html) for some packages but not the javadocs for their associated classes...
    are these things possible? i've looked into -package, -protected, and -public, but these don't seem to cover it.
    thanks in advance;
    -m

    The -include and -exclude options and @docset tag were considered for 1.4 but then decided against by the Javadoc team as we look for other solutions.
    You can document all public interfaces by passing their source filenames in to javadoc. Say, if the source files are in ./src, then:
    javadoc -d docs ./src/com/package/Interface1.java /src/com/package/Interface2.java
    You can use the wildcard asterisk here as well:
    javadoc -d docs ./src/IBI*.java
    There's no way to document the package-level documentation without the associated classes. Javadoc 1.4 has an -exclude option, but it works only to exclude packages from the -subpackages option, which is a shortcut for passing in package names.
    A workaround could be to put the package.html file in a doc-files directory and then add a link to it in overview.html. It won't be processed, so won't have the navigation bars on the top and bottom, and cannot be automatically linked to from other places (index).
    -Doug Kramer
    Javadoc team

  • Separate interfaces and classes in separate packages?

    I am writing an application in the package 'models.geometry'. I am beginning to get a growing number of interfaces with corresponding implementation classes. I therefore consider adding another packages an move all the interfaces to this package and keep the implementation in the original package:
    'models.igeometry' // for the interfaces
    'models.geometry' // for the implementation
    But is this interface/class - package separation good practice?

    First of: Usage of the prefix "I" to identify interfaces is rather rare in the Java world (it's not unheard of, but definitely not the norm). And I've never seen "i<package>" to identify a package containing interfaces, so I wouldn't suggest it.
    The question is: What does the code which uses your packages access? Does it only need the interfaces and a factory? In this case, I'd separate the packages into "models.geometry" and "models.geometry.impl".
    If the classes are first-level API, just as the interfaces (think Link/ArrayList, Map/HashMap), then I'd keep them in the same package or separate them on some other property.

  • Interfaces and implementing them

    public interface foo{
    public int blah();
    public interface foo2{
    public int blah2()
    how would I go around implementing foo and foo2

    I don't think it makes sense to have "inner interfaces". You can implement foo2 as
    public class A implements foo.foo2 {
      public int blah2() { return 2; }
    }or both interfaces (looks funny)
    public class A implements foo, foo.foo2 {
      public int blah() { return 1; }
      public int blah2() { return 2; }
    }

  • Implementing SingleThradModel interface and synchronizing service

    Hi all,
    I came across the one question.
    What is difference between the implementing SingleThradModel interface and synchronizing service method in the Servlet?
    Which one is the better one? and why?
    It seems to be same for me... but still confused?
    Please explain me.
    Thanks,
    Rahul

    No one is better. Just write threadsafe code. E.g. do not declare instance variables which are to be used per request. Just keep in mind that only one instance of the Servlet will be created which lives as long as the webapplication runs and that it will be reused among all requests. Keep request scoped variables inside the method block and you're safe.

  • Help in implementing interface

    I'm a newbie to Java Programming, and I'm faced with a assignment thats require me to implement in JAVA...help desperatly needed.
    I post the coding which i have to implement, and this is part of the many i needed to implement. I needed to sample solution to this and I will try to get on from there. Any reply is appreciated.
    package graphs;
    public interface Edge {
    // Returns node that this edge starts from.
    // Preconditions:
    // None.
    // Postconditions:
    // None.
    public Node fromNode();
    // Returns node that this edge points to.
    // Preconditions:
    // None.
    // Postconditions:
    // None.
    public Node toNode();
    // Set the label of this edge.
    // Precondtions:
    // None.
    // Postconditions:
    // None.
    public void setLabel(Object l);
    // Returns the label of this edge.
    // Precondtions:
    // None.
    // Postconditions:
    // None.
    public Object getLabel();
    package graphs;
    public interface Node {
    public void setLabel(Object l);
    public Object getLabel();
    e.g of calling class
    // Returns unique identity of edge e in the graph.
    // Preconditions:
    // + The edge e must be an edge of the graph ( hasEdge(e) == true )
    // => throws NoSuchEdge on violation.
    // Postconditions:
    // - The returned integer is in the range 0 ... numEdges() -1
    // ( Result >= 0 && Result < numEdges() ).
    public int id(Edge e);
    // Returns the edge with unique identity id in the graph.
    // Preconditions:
    // + The graph must contain at least one edge ( numEdges() > 0 )
    // throws NoEdges on violation.
    // + id must be in the range 0..numEdges() - 1 ( id >= 0 &&
    // id < numEdges() ) throws IdOutOfRange on violation.
    // Postconditions
    // - The returned edge is an edge in the graph ( hasEdge(Result) == true ).
    public Edge getEdge(int id);
    Regards

    package graphs;
    public interface Edge {
    // Returns node that this edge starts from.
    // Preconditions:
    // None.
    // Postconditions:
    // None.
    public Node fromNode();
    // Returns node that this edge points to.
    // Preconditions:
    // None.
    // Postconditions:
    // None.
    public Node toNode();
    // Set the label of this edge.
    // Precondtions:
    // None.
    // Postconditions:
    // None.
    public void setLabel(Object l);
    // Returns the label of this edge.
    // Precondtions:
    // None.
    // Postconditions:
    // None.
    public Object getLabel();
    package graphs;
    public interface Node {
    public void setLabel(Object l);
    public Object getLabel();
    package graphs;
    // Interface for the graph ADT.
    // Design by contract style assertions are used to specify semantic
    // properties for classes implementing this interface.
    // In the absence of language support for assertions, implementing
    // classes should check the assertions - implmenting classes extending
    // the GraphBase abstract class will automatically include such checks.
    // * Nodes within a graph are identified by ids that are unique for
    // all nodes in that graph.
    // * The ids for nodes with a graph are the integers from 0 to numNodes()-1
    // inclusive.
    // * A given node is a member of one and only one graph.
    // * Edges within a graph are identifed by the ids of the nodes associated
    // with the edge
    // and by ids that are unique for all edges in that graph.
    // * The ids for edges with a graph are the integers from 0 to numEdges()-1
    // inclusive.
    // * A given edge is a member of one and only one graph.
    // * There are no relationships between graphs.
    // ALTERNATIVE SPECIFICATION (DO NOT IMPLEMENT)
    // * Nodes within a graph are identified by ids that are unique for all
    // nodes in that graph.
    // * The ids for nodes within a graph are the integers from 0 to
    // numNodes()-1 inclusive.
    // * A node with id x is a member of any graph having at least x+1 nodes.
    // * Edges within a graph are identifed by the ids of the nodes associated
    // with the edge and by ids that are unique for all edges in that graph.
    // * The ids for edges with a graph are the integers from 0 to numEdges()-1
    // inclusive.
    // * A given edge e is a member of any graph having:
    // - the two nodes associated with e as members.
    // - an edge from the first of those two nodes to the second of those
    // two nodes.
    // * Relationships between graphs may be defined as for sets.
    // END OF ALTERNATIVE SPECIFICATION
    public interface Graph {
    // Number of vertices (nodes).
    // Preconditions:
    // None.
    // Postconditions:
    // - The return value >= 0 ( Result >= 0 ).
    public int numNodes();
    // Return number of edges in the graph.
    // Preconditions:
    // None.
    // Postconditions:
    // - The return value >= 0 ( Result >= 0 ).
    public int numEdges();
    // Indicates whether node n is in the graph.
    // Preconditions:
    // + The node n is non null ( n != null ).
    // Postconditions:
    // None.
    public boolean hasNode(Node n);
    // Indicates whether edge e is in the graph.
    // Preconditions:
    // + The edge e is non null ( e != null ) => throws NullEdge on violation.
    // Postconditions:
    // None.
    public boolean hasEdge(Edge e);
    // Indicates whether there is an edge from node n1 to node n2 in the graph.
    // Preconditions:
    // + Both nodes must be in the graph ( hasNode(n1) && hasNode(n2) )
    // => throws NoSuchNode on violation.
    // Postconditions:
    // None.
    public boolean hasEdge(Node n1, Node n2);
    // Returns unique identity of node n in the graph.
    // Preconditions:
    // + The node n must be a node of the graph ( hasNode(n) == true )
    // => throws NoSuchNode on violation.
    // Postconditions:
    // - The returned integer is in the range 0 ... numNodes() - 1
    // ( Result >= 0 && Result < numNodes() ).
    public int id(Node n);
    // Returns the node with unique identity id in the graph.
    // Preconditions:
    // + id must be in the range 0..numNodes() - 1 ( id >= 0 &&
    // id < numNodes() ) throws IdOutOfRange on violation.
    // Postconditions:
    // - The returned node is a node in the graph ( hasNode(Result) == true ).
    public Node getNode(int id);
    // Returns unique identity of edge e in the graph.
    // Preconditions:
    // + The edge e must be an edge of the graph ( hasEdge(e) == true )
    // => throws NoSuchEdge on violation.
    // Postconditions:
    // - The returned integer is in the range 0 ... numEdges() -1
    // ( Result >= 0 && Result < numEdges() ).
    public int id(Edge e);
    // Returns the edge with unique identity id in the graph.
    // Preconditions:
    // + The graph must contain at least one edge ( numEdges() > 0 )
    // throws NoEdges on violation.
    // + id must be in the range 0..numEdges() - 1 ( id >= 0 &&
    // id < numEdges() ) throws IdOutOfRange on violation.
    // Postconditions
    // - The returned edge is an edge in the graph ( hasEdge(Result) == true ).
    public Edge getEdge(int id);
    // Returns the edge from node n1 to node n2 in the graph.
    // Preconditions:
    // + Both nodes must be in the graph ( hasNode(n1) && hasNode(n2) )
    // => throws NoSuchNode on violation.
    // + There must be an edge from n1 to n2 in the graph
    // ( hasEdge(n1,n2) == true ) => throws NoSuchEdge on violation.
    // Postconditions:
    // - The returned edge is in the graph ( hasEdge(Result) == true ).
    public Edge getEdge(Node n1, Node n2);
    // Returns number of edges from node n.
    // Precondions:
    // The node n is in the graph ( hasNode(n) == true )
    // => throws NoSuchNode on violation.
    // Postconditions:
    // - The return value is in the range 0 ... number of nodes in
    // the graph ( Result >= 0 && Result <= numNodes() ).
    public int outDegree(Node n);
    // Returns number of edges to node n.
    // Precondions:
    // + The node n is in the graph ( hasNode(n) == true )
    // => throws NoSuchNode on violation.
    // Postconditions:
    // - The return value is in the range 0 ... number of nodes in the
    // graph ( Result >= 0 && Result <= numNodes() ).
    public int inDegree(Node n);
    // Returns first node in the graph (in order of addition).
    // Preconditions:
    // None.
    // Postconditions:
    // - The returned node is null if and only if there are no nodes in
    // the graph ( ( Result == null ) == ( numNodes() == 0 ) )
    // - The returned node is null or is contained in the graph
    // ( Result == null || hasNode(Result) == true ).
    // - The returned node has an id of 0
    // ( Result == null || id(Result) == 0 ).
    public Node firstNode();
    // Returns first edge in the graph (in order of addtion).
    // Preconditions:
    // None.
    // Postconditions:
    // - The returned edge is null if and only if there are no edges in the
    // graph ( ( Result == null ) == ( numEdges() == 0 ) )
    // - The returned edge is null or is an edge of the graph
    // ( Result == null || hasEdge(Result) == true ).
    // - The returned edge is null or has an id of 0
    // ( Result == null || id(Result) == 0 ).
    public Edge firstEdge();
    // Returns first edge from the node, n, which is the edge from source n
    // with destination node having the smallest id.
    // Preconditions:
    // + The node n must be a node of the graph
    // ( hasNode(n) == true ) => throws NoSuchNode on violation.
    // Postconditions:
    // - The returned edge is null if and only if there are no edges from
    // the node n ( ( Result == null ) == ( outDegree(n) == 0 ) )
    // - The returned edge is null or is an edge of the graph
    // ( Result == null || hasEdge(Result) == true ).
    // - The returned edge is null or points from the node n
    // ( Result == null || Result.fromNode() == n ).
    public Edge firstEdgeFrom(Node n);
    // Returns first edge to the node, n, which is the edge to destination
    // n with source node having the smallest id.
    // Preconditions:
    // + The node n must be a node of the graph
    // ( hasNode(n) == true ) => throws NoSuchNode on violation.
    // Postconditions:
    // - The returned edge is null if and only if there are no edges to
    // the node n ( ( Result == null ) == ( inDegree(n) == 0 ) )
    // - The returned edge is an edge of the graph
    // ( Result == null || hasEdge(Result) == true ).
    // - The returned edge points from the node n
    // ( Result == null || Result.fromNode() == n ).
    public Edge firstEdgeTo(Node n);
    // Returns last edge from the node, n, which is the edge from source n
    // with destination node having the largest id.
    // Preconditions:
    // + The node n must be a node of the graph
    // ( hasNode(n) == true ) => throws NoSuchNode on violation.
    // Postconditions:
    // - The returned edge is null if and only if there are no edges from
    // the node n ( ( Result == null ) == ( outDegree(n) == 0 ) )
    // - The returned edge is null or is an edge of the graph
    // ( Result == null || hasEdge(Result) == true ).
    // - The returned edge is null or points from the node n
    // ( Result == null || Result.fromNode() == n ).
    public Edge lastEdgeFrom(Node n);
    // Returns last edge to the node, n, which is the edge to destination
    // n with source node having the largest id.
    // Preconditions:
    // + The node n must be a node of the graph
    // ( hasNode(n) == true ) => throws NoSuchNode on violation.
    // Postconditions:
    // - The returned edge is null if and only if there are no edges to
    // the node n ( ( Result == null ) == ( inDegree(n) == 0 ) )
    // - The returned edge is an edge of the graph
    // ( Result == null || hasEdge(Result) == true ).
    // - The returned edge points from the node n
    // ( Result == null || Result.fromNode() == n ).
    public Edge lastEdgeTo(Node n);
    // Returns next node in the graph after node n or null if n is the last
    // node.
    // Preconditions:
    // + The node n must be a node of the graph
    // ( hasNode(n) == true ) => throws NoSuchNode on violation.
    // Postconditions:
    // - The returned node is null or is contained in the graph
    // ( Result == null || hasNode(Result) == true ).
    // - The returned node is null if and only if the node is the node
    // having the maximum id
    // ( ( Result == null) == ( id(Result) == numNodes() - 1 ) ).
    // - The returned node is null or the id of the returned node is
    // equal to the id of n + 1
    // ( Result == null || id(Result) == id(n) + 1 ).
    public Node nextNode(Node n);
    // Returns next edge after e or null if e is the last edge.
    // Preconditions:
    // + The edge e must be an edge of the graph ( hasEdge(e) == true )
    // => throws NoSuchEdge on violation.
    // Postconditions:
    // - The returned edge is null or is contained in the graph
    // ( Result == null || hasEdge(Result) == true )
    // - The returned edge is null if and only if e is the edge with the
    // maximum id
    // ( ( Result == null) == ( id(e) == numEdges() -1 ) ).
    // - The returned edge is null or the id of the returned edge is equal
    // to the id of e +1
    // ( Result == null || id(Result) == id(e) + 1 ).
    public Edge nextEdge(Edge e);
    // Returns next edge from node n after e or null if e is the last such edge.
    // Preconditions:
    // + The node n must be an edge of the graph ( hasNode(n) == true )
    // => throws NoSuchNode on violation.
    // + The edge e must be an edge of the graph ( hasEdge(e) == true )
    // => throws NoSuchEdge on violation.
    // + The edge e must be an edge from the node n ( e.fromNode() == n )
    // => throws NoSuchEdge on violation.
    // Postconditions:
    // - The returned edge is null or is contained in the graph
    // ( Result == null || hasEdge(Result) == true )
    // - The returned edge is null or is from the node n
    // ( Result == null || Result.fromNode() == n ).
    // - The returned edge is null or the id of the node to which the
    // returned edge points is greater than the id of the node to
    // which e points
    // ( Result == null || id(Result.toNode()) > id(e.toNode()) ).
    public Edge nextEdgeFrom(Node n, Edge e);
    // Returns next edge to node n after e or null if e is the last such edge.
    // Preconditions:
    // + The node n must be an edge of the graph ( hasNode(n) == true )
    // => throws NoSuchNode on violation.
    // + The edge e must be an edge of the graph ( hasEdge(e) == true )
    // => throws NoSuchEdge on violation.
    // + The edge e must be an edge to the node n ( e.toNode() == n )
    // => throws NoSuchEdge on violation.
    // Postconditions:
    // - The returned edge is null or is contained in the graph
    // ( Result == null || hasEdge(Result) == true )
    // - The returned edge is null or is to the node n
    // ( Result == null || Result.toNode() == n ).
    // - The returned edge is null or the id of the node from which the
    // returned edge points is greater than the id of the node
    // from which e points
    // ( Result == null || id(Result.fromNode()) > id(e.fromNode()) ).
    public Edge nextEdgeTo(Node n, Edge e);
    // Create and add a node to the graph with label l.
    // Preconditions:
    // None.
    // Postconditions:
    // - The number of nodes has increased by one
    // ( numNodes() == old( numNodes() + 1 ) ).
    // - The returned node is in the graph ( hasNode(Result) ).
    // - The id of the returned node is the maximum id for any node in
    // the graph ( id(Result) == numNodes()-1 ).
    public Node createNode(Object l);
    // Create and adds an edge from node n1 to node n2 with label l
    // Preconditions:
    // + Both nodes must be in the graph ( hasNode(n1) && hasNode(n2) )
    // => throws NoSuchNode on violation.
    // + There must not already be such an edge in the graph
    // ( hasEdge(n1,n2) == false ) => throws DuplicateEdge on violation.
    // Postconditions:
    // - The number of edges in the graph is increased by one
    // ( numEdges() == old(numEdges()) + 1 )
    // - The out degree of node n1 is increased by one
    // ( outDegree(n1) == old(outDegree(n1)) + 1 )
    // - The in degree of node n2 is increased by one
    // ( inDegree(n2) == old(inDegree(n2)) + 1 )
    // - The returned edge is from node n1 and to node n2
    // ( Result.fromNode() == n1 && Result.toNode() == n2 )
    // - The returned edge is in the graph ( hasEdge(Result) == true )
    // - The returned edge has label lbl ( Result.getLabel().equal(l) ).
    // - The id of the returned edge is the maximum id for any edge in
    // the graph ( id(Result) == numEdges()-1 ).
    // - The returned edge is either the last edge from node n1 or the next
    // edge from node n1 after the returned edge points to a node
    // having an id that is greater than the id of the node that
    // the returned edge points to.
    // ( ( nextEdgeFrom(n1,Result) == null ) ||
    // ( id((nextEdgeFrom(n1,Result)).toNode())
    // > id(Result.toNode()) ) )
    // - The returned edge is either the last edge to node n2 or the next
    // edge to node n2 after the returned edge points from a node
    // having an id that is greater than the id of the node that
    // the returned edge points from.
    // ( ( nextEdgeTo(n2,Result) == null ) ||
    // ( id((nextEdgeTo(n2,Result)).fromNode())
    // > id(Result.fromNode()) ) )
    // - The returned is either the first edge from node n1 or the id of the
    // node the returned edge points to is greater than the id of the
    // node the first edge from node n1 points to
    // ( ( firstEdgeFrom(n1) == Result ) ||
    // ( id((firstEdgeFrom(n1)).toNode())
    // < id(Result.toNode()) ) )
    // - The returned is either the first edge from node n1 or the id of the
    // node the returned edge points to is greater than the id of the
    // node the first edge from node n1 points to
    // ( ( firstEdgeTo(n2) == Result ) ||
    // ( id((firstEdgeTo(n2)).fromNode())
    // < id(Result.fromNode()) ) )
    public Edge createEdge(Node n1, Node n2, Object l);
    import graphs.*;
    public class Printer {
    private static Graph make() {
         Graph g = new GraphBase(new GraphImp());
         // Create some nodes
         Node first = g.createNode(new Integer(1));
         Node second = g.createNode(new Integer(2));
         Node third = g.createNode(new Integer(3));
         Node fourth = g.createNode(new Integer(4));
         // Create some edges between the nodes
         Edge fs = g.createEdge(first, second, new Integer(1));
         Edge ff = g.createEdge(first, first, new Integer(2));
         Edge ft = g.createEdge(first, third, new Integer(4));
         Edge ts = g.createEdge(third, second, new Integer(3));
         Edge sf = g.createEdge(second, first, new Integer(5));
         Edge s4 = g.createEdge(second, fourth, new Integer(8));
         return g;
    protected static void print(Graph g) {
         System.out.println("Nodes: " + g.numNodes() + " Edges: " + g.numEdges());
         // Print graph as a list of adjacency lists.
         System.out.println("\nAdjacency lists:");
         for ( Node node = g.firstNode(); node != null ; node = g.nextNode(node) ) {
         System.out.println("Node " + g.id(node) + " has:");
         // Print the node's out edges
         if ( g.outDegree(node) == 0 ) {
              System.out.println("\tNo out edges");
         } else {
              System.out.print("\t" + g.outDegree(node) + " out edge" + (g.outDegree(node) > 1 ? "s" : "") + ":");
              for ( Edge ed = g.firstEdgeFrom(node); ed != null ; ed = g.nextEdgeFrom(node,ed) ) {
              System.out.print(" (" + g.id(ed.fromNode()) + "->" + g.id(ed.toNode()) + ":" + ed.getLabel().toString() + ")");
              System.out.println("");
         // Print the node's in edges
         if ( g.inDegree(node) == 0 ) {
              System.out.println("\tNo in edges");
         } else {
              System.out.print("\t" + g.inDegree(node) + " in edge"+ (g.outDegree(node) > 1 ? "s" : "") +":");
              for ( Edge ed = g.firstEdgeTo(node); ed != null; ed = g.nextEdgeTo(node,ed) ) {
                   System.out.print(" (" + g.id(ed.fromNode()) + "->" + g.id(ed.toNode()) + ":" + ed.getLabel().toString() + ")");
              System.out.println("");
         // Print graph as an adjacency matrix.
         System.out.println("\nAdjacency matrix:");
         for(int col = 0; col < g.numNodes(); col++ ) {
         System.out.print("\t" + col);
         System.out.println("");
         for(int row = 0; row < g.numNodes(); row++ ) {
         System.out.print(row);
         for(int col = 0; col < g.numNodes(); col++ ) {
         if ( g.hasEdge(g.getNode(row), g.getNode(col)) ) {
         System.out.print("\t" + g.getEdge(g.getNode(row), g.getNode(col)).getLabel().toString());
         } else {
         System.out.print("\t-");
         System.out.println("");
         // Print graph as a list of edges
         System.out.println("\nEdge list:");
         for( int edgeId = 0; edgeId < g.numEdges(); edgeId++ ) {
         Edge edge = g.getEdge(edgeId);
         System.out.println("Edge " + edgeId + " from " + g.id(edge.fromNode()) + " to " + g.id(edge.toNode()) + " with label " + edge.getLabel().toString());
    public static void main(String[] args) {
         try {
         Graph g = make();
         print(g);          
         } catch(Error e) {
         System.err.println("### Execution terminated with errors ###");
    Sorry.. I think the questions that's I posted is not complete... I have input more codes to make it more complete. And many thanks to the person that replied... many thanks and hope you can reply to this. Thanks again.
    I need to implement only the GraphImp class and I think it should be
    public class GraphImp implements Graph, Node, Edge
    Implementing Node and Edge is onl used interally in GraphImp and need not to be public.
    Any help is appreciated.. and if possible... good programmers out there... please drop me an email to my problem.... million million thanks..

  • What is the diffrence between My Runnable Interface and Java Runnable

    Hi folks
    all we know that interfaces in java just a decleration for methods and variables.
    so my Question is why when i create an interface its name is "Runnable" and i declared a method called "run" inside it.then when i implements this interface with any class don't do the thread operation but when i implement the java.lang.Runnable the thread is going fine.
    so what is the diffrence between My Runnable Interface and Java Runnable?
    thnx

    Hi folks
    all we know that interfaces in java just a decleration
    for methods and variables.
    so my Question is why when i create an interface its
    name is "Runnable" and i declared a method called
    "run" inside it.then when i implements this interface
    with any class don't do the thread operation but when
    i implement the java.lang.Runnable the thread is going
    fine.
    so what is the diffrence between My Runnable Interface
    and Java Runnable?
    thnxClasses and interfaces are not identified by just their "name", like Runnable. The actual "name" the compiler uses is java.lang.Runnable. So even if you duplicate the Runnable interface in your own package, it's not the same as far as the compiler is concerned, because it's in a different package.
    Try importing both java.util.* and java.awt.* (which both have a class or interface named List), and then try to compile List myList = new ArrayList();

  • Need information about interfaces and namespaces in actionscript 3.0

    Hi,
    I need information about actionscript interfaces and
    namespaces, I'm preparing for ACE for Flash CS3 and I need to learn
    about this subjects and I can not find resources or simple examples
    that make these subjects understandable.
    Anybody can help me!
    Thanks a lot.

    Interfaces (cont.)
    Perhaps the most useful feature of interfaces is that you not
    only can define the data type but also method signature of the
    class that implements this interface. In other words, interface can
    define and enforce what methods class MUST implement. This is very
    useful when classes are branching in packages and team of
    developers works on a large application among others.
    The general syntax for an Interface with method signatures is
    written the following way:
    package{
    public interface InterfaceName {
    // here we specify the methods that will heave to be
    implemented
    function method1 (var1:dataType,
    var2:datType,…):returnType;
    function method2 (var1:dataType,
    var2:datType,…):returnType;
    To the previous example:
    package{
    public interface IQualified {
    function method1 ():void;
    function method2 ():int;
    Let’s write a class that implements it.
    If I just write:
    package{
    public class ClassOne extends DisplayObject implements
    IQualified {
    public function ClassOne(){}
    I will get a compilation error that states that I did not
    implement required by the interface methods.
    Now let’s implement only one method:
    package{
    public class ClassOne extends DisplayObject implements
    IQualified {
    private function method1():void{
    return;
    public function ClassOne(){}
    I will get the error again because I implemented only one out
    of two required methods.
    Now let’s implement all of them:
    package{
    public class ClassOne extends DisplayObject implements
    IQualified {
    private function method1():void{
    return;
    private function method2():int{
    return 4;
    public function ClassOne(){}
    Now everything works OK.
    Now let’s screw with return datatypes. I attempt to
    return String instead of void in method1 in ClassOne:
    private function method1():String{
    return “blah”;
    I am getting an error again – Interface requires that
    the method1 returns void.
    Now let’s attempt to pass something into the method1:
    private function method1(obj:MovieClip):void{
    return;
    Oops! An error again. Interface specified that the function
    doesn’t accept any parameters.
    Now rewrite the interface:
    package{
    public interface IQualified {
    function method1 (obj:MovieClip):void;
    function method2 ():int;
    Now compiler stops complaining.
    But, if we revert the class back to:
    private function method1():void{
    return;
    compiler starts complaining again because we don’t pass
    any parameters into the function.
    The point is that interface is sort of a set of rules. In a
    simple language, if it is stated:
    public class ClassOne implements IQualified
    it says: “I, class ClassOne, pledge to abide by all the
    rules that IQualified has established and I will not function
    correctly if I fail to do so in any way. (IMPORTANT) I can do more,
    of course, but NOT LESS.”
    Of course the class that implements an interface can have
    more that number of methods the corresponding interface requires
    – but never less.
    MORE means that in addition to any number of functions it can
    implement as many interfaces as it is desired.
    For instance, I have three interfaces:
    package{
    public interface InterfaceOne {
    function method1 ():void;
    function method2 ():int;
    package{
    public interface InterfaceTwo {
    function method3 ():void;
    package{
    public interface InterfaceThree{
    function method4 ():void;
    If our class promises to implement all three interface it
    must have all four classes in it’s signature:
    package{
    public class ClassOne extends DisplayObject implements
    InterfaceOne, InterfaceTwi, InterfaceThree{
    private function method1():void{return;}
    private function method2():int{return 4;}
    private function method3():void{return;}
    private function method4():void{return;}
    public function ClassOne(){}
    Hope it helps.

  • Is licence required for implementing JavaTv and JMF.

    Hi,,
    I am trying to develop GEM middleware for my STB,
    The STB has OS20 as RTOS and implemented on an ST chip
    This GEM is DVB MHP minus DVB.
    We have to implement JavaTV package and JMF for that,
    But do we have to pay any royalty to SUN for implementing the JavaTV or JMF packages or can we implement the binary versions of the packages.
    Please letme know how to implement the following packages
    org.havic.*
    org.davic.*
    javax.tv.*
    org.dvb.*
    and JMF?

    Hi Rohit,
    let me also add a few words. In principle the process Sales Order Processing B2B with ERP sales order in CRM Web Channel means that you setup (a) Web shop(s) that use and display the CRM product catalog but create orders directly in SAP ERP without first creating them in SAP CRM. It also allows to use certain E-Marketing features of CRM in the Web shop. The CRM product catalog in this process can only be used if you do use the TREX. There is no way of directly call up the catalog from CRM in the Web shop by bypassing the TREX.
    In the SAP E-Commerce for SAP ERP solution (ECO ERP) we in contrast offer the possibility to use the ERP catalog without the TREX. In this solution you can use the Memory Catalog which is not using the TREX. This solution by this way allows to directly use and display the ERP catalog and create orders directly in SAP ERP.
    For the CRM catalog in contrast we do not have something similar to the Memory Catalog. Instead you DO need to use the TREX to display the CRM catalog in the Web shop.
    The only option you have to "avoid" the TREX i a CRM web shop is what Easwar and Christoph have written about: The usage of an external catalog from a 3rd party catalog engine via the Open Catalog Interface (OCI) in the CRM Web shop. This we do offer for the CRM Web shop. However if you do not have an external catalog engine and want to use the CRM catalog then again you do need to use the TREX. It does not matter if you do not want to use product search nor prices other than fro ERP sales order.
    Greetings
    Torsten Kliesch

  • Class and package names

    I'm novice in Java, but not novice in programming. So, it is not a problem to understand and to write simple samples, but it is still hard to create a good package structure and give good names for classes.
    For example now, I started writing simple standalone application, which will be run by cron and will communicate with 2 webservices. I will receive data(reports) from one webservice, and will send this data to another one. From the very beggining, I have a poblem about structure of roject and naming. Is it ok, to make only one class, with name for example ReportApp? Or better create one class for communicating with first service, another - with second, and main class will call methods of this classes? Also package name... I think it is good, when from package you see, that i is service, or xml.util etc. How can I show in package name that it is batch standalone application? Can somebody explain what names for classes and packages he'll use for such task, please.

    Descriptive names are nice....
    For packages, a standard method is a domain name for your company or organization:
    com.widgetsRus.service.
    com.widgetsRus.ui.
    com.widgetsRus.util.
    As for class names, just descripe what the class is for. ReportServer, ReportClient, Report (interface), AbstractReport (implements Report), StatusReport (extends AbstractReport), etc...
    As for creating a class for this and that, or separate classes, that's a design issue, but typically, it's easier to maintain things if they are kept in smaller classes with related functionality.

  • How to compile and package my EJB application

    Hi,
    I just ran the sample programs from the Sun J2EE tutorial. Seems to work fine. I used the ant utility to compile all the programs and the J2EE Deployment Wizard to package and deploy everything. Now how do I compile and deploy a sample EJB program that I have written ?
    I am using the following platforms:
    1: JBuilder 3.0 : IDE (for writing the source code)
    2: JDK 1.4.0_01
    3: J2SDK EE 1.3.1 (EJB/Appln server)
    How do I make ant recognize my program and compile it... i guess the deployment procedure would still be the same.
    Can somebody please help me out on this ??
    Thanks
    prasanna

    Hi,
    Thanks for your prompt reply. I tried that out.. I have a directory called "customer" under which I have my interfaces,bean implementation class and the J2EE application client.
    ANT_HOME is set to : the directory where ant is installed
    JAVA_HOME is set to : the directory where JDK is installed
    J2EE_HOME is set to : the directory where J2EE server is installed
    and PATH : includes the bin directories of JDK, ant and J2SDK EE
    These are the paths I had to set when I ran the J2EE tutorial programs. It worked fine.
    Now when I say : ant myprogram I get an error saying:
    BUILD FAILED
    Target "myprogram" does not exist in this project
    How do I add my program also to the project so that ant can recognize it ?
    Also if there is any other way you can suggest to compile and package my application it would be great...
    Thanks
    prasanna

  • Project implementation  process and toll using for the implemetation

    what r the steps involved in project implementaion

    hi,
    The ASAP methodology is recommended by SAP for implementation planning and system implementation. It has the following phases.
    Project Preparation - The primary focus of Phase 1 is getting the project started, identifying team members and developing a high-level plan.
    Business Blueprint - The primary focus of Phase 2 is to understand the business goals of the company and to determine the business requirements needed to support those goals.
    Realization - The purpose of this phase is to implement all the business and process requirements based on the Business Blueprint. You customize the system step by step in two work packages, Baseline and Final configuration.
    Final Preparation - The purpose of this phase is to complete testing, end-user training, system management and cut over activities. Critical open issues are resolved. Upon the successful completion of this phase, you will be ready to run your business in your productive R/3 system.
    Go Live and Support - Transition from a project oriented, pre-productive environment to a successful and live productive operation.
    Def:The Accelarated SAP is the implementation solution provided by SAPwhich integrates several components that works in conjunction to support the rapid and efficient implementation of the PROJECT.
    PHASES IN ASAP METHODOLOGY
    1.Project Preparation
    2.Business Blue Print
    3.Realization
    4.Final Preparation
    5.Go-Live and Support.
    1.PROJECT PREPARATION WE HAVE 8 STEPS.
    1A.SCOPE OF PROJECT
    1B.PHASES INVOLVED
    1C.SYSTEM LANDSCAPE
    1D.TEAM FORMATION
    1E.DEADLINES OF THE PROJECT
    1F.BUSINESS PROCESS DOCUMENTS (OR) BUSINESS REQUIREMENT
    SPECIFICATIONS
    IN 1F AGAIN WE HAVE 5 STEPS....Pls dont get confused.
    1F ->A1-REQUIREMENTS OR EXPECTATIONS
    A2-GENERAL EXPLANATIONS
    A3-SPECIAL ORGANIZATIONAL CONSIDERATIONS
    A4-CHANGES TO EXISTING ORGANIZATION
    A5-DESCRIPTION OF IMPROVEMENTS
    1G-TECHNICAL REQUIREMENTS
    1H-KICK-OFF MEETING
    2 BUSINESS BLUE PRINT . IN THIS WE HAVE 8 STEPS
    2A.ORGANIZATIONAL STRUCTURE
    2B.DATA COLLECTION SHEETS
    2C.DATA CONVERSION STRATEGY
    2D.BUSINESS BLUE PRINT DOCUMENTATION
    2E.CUSTOMIZATION
    2F.ESTIMATION OF DEVELOPERS
    2G.COMMUNICATION STRATEGY PLAN
    2H.DEVELOP THE SYSTEM ENVIRONMENT
    2I.USER ROLES AND AUTHORIZATIONS.
    3. REALIZATION . HERE WE HAVE 7 STEPS.
    3A.ORGANIZATIONAL CHANGE MANAGEMENT
    3B.BASELINE CONFIGURATION & CONFIRMATION
    3C.UNIT TESTING
    3D.FINAL CONFIGURATION AND CONFIRMATION
    3E.FUNCTIONAL SPECIFICATIONS.IN 3E , WE HAVE 3 STEPS AGAIN...
    3E1.SOLUTION INFORMATION
    3E2.OBJECT INFORMATION
    3E3.REVISION HISTORY....WE HAVE 12 STEPS HERE .....
    3E3A.DESCRIPTION AND PURPOSE
    3E3B.BUSINESS PROCESS DETAILS
    3E3C.CURRENT FUNCTIONALITY
    3E3D.EXPECTED FUCNTIONALITY
    3E3E.SAP SITUATIONAL ANALYSIS
    3E3F.ADDITIONAL INFORMATION
    3E3G.FORMS
    3E3H.REPORTS
    3E3I.INTERFACE
    3E3J.DATA MAPPING
    3E3K.APPROVAL AND MODIFICATION HISTORY
    3E3L.ADDITIONAL ATTACHMENTS.
    3F.TESTING THE PROGRAMS
    3G.PREPARING THE ENDUSER DOCUMENTATION
    4.FINAL PREPARATION
    WE HAVE 4 STEPS.....
    4A.UPLOADING THE STIMULATED DATA
    4B.INTEGRATION TESTING
    4C.CUTOVER ACTIVITIES
    4D.PRE GO-LIVE END USER TRAINING
    5.GO-LIVE AND SUPPORT
    SIGN-OFF MEETING
    CHAN

  • Implementing interface problems

    I developed an interface and when I try to implement it and compile I get the following compile time error:
    File C:\projects\dynamicload\crio.java does not contain crio as expected. Please adjust the class path so that the file does not appear in the unnamed package.
    C:\projects\dynamicload\test.java(3) : Interface crio of test not found
    process.java is the implementing class. crio.java is the interface.

    Without looking at the actual code it sounds like the access modifier may have been incorrect. If one was not specified then the default was "package friendly." The implementing class must have been in the same package. If one had no package listed and the other did then the packages were different and one could not access the other with the default access modifier.
    send code for more clarification

  • External Interface and Mouse Clicks

    I'm new to writing ActionScript.
    I am working in .NET (C#) environment using
    AxShockwaveFlashObjects.
    I am simply trying to react to a mouse click on the Flash
    ActiveX Control.
    I have inserted the code in a layer only used for script:
    import flash.external.ExternalInterface;
    var mouseListener:Object = new Object();
    var boolMouseDown:Boolean = false;
    mouseListener.onMouseDown = function ()
    boolMouseDown = true;
    mouseListener.onMouseUp = function()
    if (boolMouseDown)
    ExternalInterface.call("MouseClicked", "NavigateToURL", "
    http://www.adobe.com");
    boolMouseDown = false;
    Mouse.addListener(mouseListener);
    I get the MouseClick event in my C# code. The problem is that
    I get TWO of the same event ??
    Can someone tell me why or how I should be doing this to get
    only one event.
    Thanks,
    Steve

    Take a look at java.awt.event.MouseAdapter, which implements interfaces MouseListener, MouseMotionListener, MouseWheelListener and EventListener.
    For sample codes on how to use these classes, read through the posts on the Swing forum and you'll find plenty.
    If you have a more specific question, feel free to post back.
    db

  • Is there a way to package part of a multi-page document -- eg: one page or a spread?

    Doing a newspaper: I have lots of uses for extracting part of the many page documents to send to someone else. I want to send it to them with links and fonts but only that which is for that or those pages.
    In the past I have had to delete all the unwanted pages which is very slow because there are a lot of unnecessary pages for this instance, and for some reason isn't allowing me to delete more than one at a time. I'm not sure why that is either. But if I can package a portion of the paper, that would do me.
    Thanks.

    Alternately you can select the pages that you want to package in the pages panel and chose move and move to a new document(create it before hand) and package that document rather than the original.

Maybe you are looking for

  • CC Tab says "Download error. Please contact customer support."

    When I started my laptop this morning CC had a red ! on its icon and the follwing message under Apps: "Download error. Please contact customer support." I've got 2 issues with this: I don't recall downloading any apps yesterday and the handy link doe

  • Ease in/out for a scaling image?

    I have an image with a keyframe on the first frame and one on the last, and I have the image scaling up on the last frame. I'm not happy with how CS6 is scaling the image up, I would like to have it do it smoother. I right click on the last keyframe

  • Setting monitoring level for a Proxy Service programmatically

    Hi there - We've successfully created a Weblogic ALSB domain from scratch using WLST. Now we'd like to adjust the monitoring level of our Proxy Services programmatically. Are there any code samples illustrating how to achieve that? The setServiceLogL

  • Active Content Update Issue

    I hope someone can help me! Here is the deal, I want to make a button that will open a blank page with a PDF document. I can get it to work with GETurl, but I cannot figure out how to apply active content update to the new page. It works fine on a Ma

  • Transfer of custom control property one exit to another exit

    Hi expert     I have created one custom control in the exit EXIT_SAPLCOKO_005 for entering long text (TCODE : COR2) and I want to transfer     the same custom control propert to exit EXIT_SAPLCOKO_006 .How can i transfer this.In this case the scope o