Consider I have the following interface:
public interface A { public void b(); }
However I want each of the classes that implement it to ha
Generics.
public interface A{
public E b();
}
public class C implements A{
public C b(){
return new C();
}
}
public class D implements A{
public D b(){
return new D();
}
}
Search up generics for more details, but (very) basically, what's happening is that A leaves E's type up to the implementing clases (C and D).
So basically A doesn't know (and doesn't have to know) what E might be in any given implementation.