Let us have the following classes defined in eclipse's work space:
public abstract class A {
public void foo() {
System.out.println("Hi.. this is foo()");
}
}
public interface I {
void foo();
}
public class B extends A implements I {
public void bark() {
System.out.println("Hi.. this is bark()");
}
}
public class C {
public void woo() {
I i = new B();
i.foo();
}
}
Now the problem is eclipse doesn't show any references for A.foo() on searching through
References -> Project or
References - Hierarchy
I see this a design issue. What do you think? Please post your comment on this.
put this on stackoverflow to get a better response?
ReplyDeleteAlso,
ReplyDeletepublic class C {
public void woo() {
I i = new B();
i.foo();//references cannot be found from A.foo() since A has not implemented I
B b = new B();
b.foo();<-- A.foo() found this reference by Eclipse in "References -> Project"
A a = new B();
a.foo();<-- A.foo() found this reference by Eclipse in "References -> Project"
}
}
http://stackoverflow.com/questions/6842587/is-this-a-design-issue-or-eclipses-issue-or-javas-loophole
ReplyDeleteIs it better to have an abstract class A implements I
ReplyDeleteAh..! I was fool.. this is a design issue.
ReplyDelete