posted 23 years ago
Hi,
Would like to add that it is always better to program to an interface rather than program to a class.The advantage you get is you can change the stub without any requirement for client compilation.This cannot be possible when you program to a class.
Hence,
AnInterface ai = new AnInterfaceImpl();
is better than
AnInterfaceImpl aii = new AnInterfaceImpl();
It is bad programming to implement the methodOne() without throwing an exception.Remember that the interface signifies responsibilities which every implementing class must adhere to.
Hope this helps,
Sandeep
SCJP2, OCSD(Oracle JDeveloper), OCED(Oracle Internet Platform)
[This message has been edited by Desai Sandeep (edited July 25, 2001).]