Original Post
So I know that circular classes are possible, for example
class ListNode {
ListNode next;
//some variables
//some methods
}
Earlier, I tried writing code that essentially did this:
package P1;
import P2.B;
class A {
//etc,etc.
}
and
package P2;
import P1.A;
class B {
//etc,etc.
}
Compiler error. Is there any way to make packages have circular references, or should I just put classes A and B in the same package if they are co-dependent?
class ListNode {
ListNode next;
//some variables
//some methods
}
Earlier, I tried writing code that essentially did this:
package P1;
import P2.B;
class A {
//etc,etc.
}
and
package P2;
import P1.A;
class B {
//etc,etc.
}
Compiler error. Is there any way to make packages have circular references, or should I just put classes A and B in the same package if they are co-dependent?