Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Posts
    55

    Unanswered: packages in java..hellpp..URGENT!

    Hi all

    I have a doubt..
    I have 2 packages A and B and they contain files named a.java and b.java respectively
    Now in a.java i want to include the file from package B which is b.java.
    Can anyone tell me how to do it..if i try to just include by importing B it tries looking for package B within A and gives me an error..
    Please tell me how I can do this task...need it urgently..ne source code..examples wud be gr88!

    thnx in advance

    -s
    You try and try again..but then give up, there's no sense in being a complete fool about it!!!

  2. #2
    Join Date
    Mar 2003
    Location
    Denmark
    Posts
    15
    In A.a.java:
    -------------------------
    package A;
    import B.*;
    -------------------------

    In B.b.java:
    -------------------------
    package B;
    -------------------------

    Both packages should reachable via the classpath, whether they are folders (\A\a.class and \B\b.class) or a JAR/ZIP.

    I do however not recommend having classes wihtout capital starting letter...


    /Carsten

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •