Answer Posted / rahul
The most important technical distinction between creating a
derived class and implementing an interface is that a
derived class can only inherit from one base class, but a
class can implement any number of interfaces.
From a design standpoint, think of inheritance as expressing
a specialization hierarchy. If WebSalesOrder "is a" special
kind of SalesOrder, you might consider making it a derived
class.
However, you need to be very careful that you don't use
inheritance when the specialization that distinguishes a
derived class from a base class is a feature that other
classes will also need to support. For adding those kinds of
features or capabilities to a class, implementing interfaces
will give you much greater flexibility.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is mdb and what is the special feature of that?
What is a sessionfactory? Is it a thread-safe object?
What are the different class loaders used by jvm?
What is Stream Tokenizer?
Explain about RMI Architecture?
What is the purpose of the wait() method?
Why use a datasource when you can directly specify a connection details? (in a J2EE application)
What is glasgow?
Where we can write Rmi registry in the code, without having to write it at the command prompt?
How to implement RMI in Java?
What is bean? Where can it be used?
Explain the difference between object state and behavior?
Describe responsibilities of Activator?
What is the difference between RMI and Corba?
What is the difference between the ‘font’ and ‘fontmetrics’ class?