Some sort of interface method needed?
Posted on 2005-04-01
I've got a normal class that does a couple of things, nothing fancy. I want an interface method, so that:
B mb=new B();
//When something happens in this class, call an interface method (Z for instance) in this class.
However, when the method Z in B.java is called, I want the exact same method to be called in A.java. It seems like I need some interface method, where you can't create an instance of class B unless the class creating the instance (A) has this interface method (Z) in it... Anybody any ideas on how I can do this?