Hi,
I'm sorry for making the question unclear, but my English is not good.
I will try to explain it:
class test0{
test1 t1 = new test1();
public static void main(String args[]){
new test0();
}
public test0(){
t1.displaymsg1();
t1.callDisplaymsg0();
}
public void displaymsg0(){
System.out.println("Successfully linked to test0 class");
}
}
class test1{
test0 t0 = new test0();
public void callDisplaymsg0(){
t0.displaymsg0();
}
public void displaymsg1(){
System.out.println("Successfully linked to test1 class");
}
}
Class test0 can "new test1()", and access its members. But when I try to "new test0()" in class test1, to access class test0's members, it floods the screen with many lines of errors like:
at test1.<init>(test0.java:16)
at test0.<init>(test0.java:2)
at test1.<init>(test0.java:16)
at test0.<init>(test0.java:2)
and I could not read the first lines of the error, so I don't know what the error is..
So my question is:
How to access class test0 members from class test1?
Thanks a lot in advance!