sir,If interface has got four methods,and I like to implement only two methods, how this could be achieved?
Joined: Nov 09, 2005
If you mark the class implementing the interface as abstract, you only need to provide either partial, or default implementations of the method stubs defined in the interface. This type of class is typically called an Adapter. The remaining methods will then need to be implemented fully in a concrete subclass that inherits from this Adapter.
Be aware however, that by marking a class as abstract, you cannot instantiate it. You will have to instantiate a concrete subclass that has implementations of all of the methods defined by the interface.
Joined: Aug 05, 2006
Eventually, instantiated classes that implement the interfaces must have a method that implements the methods on the interface.
However, if the methods on the interface do not apply in a particular situation or should not be called on a specific class that implements that interface, you can do this: