--- Jonathan Boutelle <[EMAIL PROTECTED]> wrote:
> The first problem is the package declarations. Your
> declarations need to
> reflect the entire structure.
> for class A
> package a;
> for class B
> package a.b;
> for class C
> package a.b.c;
>
> The second problem is that your imports need to
> reflect the entire
> structure, for example, class A should import B like
> this
> import a.b.B;
>
> and class B should import C like this
> import a.b.c.C;
>
> J
Hi again,
i got the changes as you mentioned...
---------------------------A.java---------------------
package a;
import a.b.*;
class A
{
public static void main(String args[])
{
System.out.println(">In a");
B bob=new B();
}
}
---------------------------A.java---------------------
---------------------------B.java---------------------
package a.b;
import a.b.c.*;
public class B
{
public B()
{
System.out.println(">In b");
C.test();
}
}
---------------------------B.java---------------------
---------------------------C.java---------------------
package a.b.c;
public class C
{
public static void test()
{
System.out.println("in c");
}
}
---------------------------C.java---------------------
C.java compiled successfully...
B.java gave follwing errors...
============================javac====================
B.java:3: package a.b.c does not exist
import a.b.c.*;
^
B.java:12: cannot resolve symbol
symbol : variable C
location: class a.b.B
C.test();
^
2 errors
Output completed (2 sec consumed) - Normal Termination
============================javac====================
A.java gave follwing errors at compile time..
============================javac====================
---------- javac ----------
A.java:3: package a.b does not exist
import a.b.*;
^
A.java:12: cannot resolve symbol
symbol : class B
location: class a.A
B bob=new B();
^
A.java:12: cannot resolve symbol
symbol : class B
location: class a.A
B bob=new B();
^
3 errors
Output completed (1 sec consumed) - Normal Termination
============================javac====================
need more direction, what/where am i doing something
wrong!
thanks & regards,
rohit
=====
NAMASTE, i honour the spirit in you which is also in me.
```````````````````````````````````````````````````````
http://www.geocities.com/rohitsz2
|Anytime you feel i need to understand|
|a concept before i am eligible to get|
|an answer i would be happy to know. |
^*************************************^
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail
_______________________________________________
Java mailing list
[email protected]
http://mail.jug-delhi.org/mailman/listinfo/java_jug-delhi.org