How do I do forward declarations in Java?
I have two classes, each needs to call a method in the other and they both reside within different namespaces. For example...
package one;
class A {
public void foo() {
B b = new B();
b.bah();
}
}
and
package two;
class B {
public void bah() {
A a = new A();
a.foo();
}
}
UPDATE
In Eclipse when this code is encountered a compile time error would be thrown up "A cycle was detected in the build path...".