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 class is the top of the awt event hierarchy?
Where can I find seam examples and documentation?
What is the purpose of the finally clause of a try-catch-finally statement?
Define the remote object implementation?
What are callback interfaces?
What is a session? Can you share a session object between different theads?
Can I use javascript to submit a form?
What is synchronization and why is it important?
When a thread blocks on i/o, what state does it enter?
Why does the tag url-encode javascript and mailto links?
Why use POJO when I can use hashmap
What is RMI and what are the services in RMI?
How a component can be placed on Windows?
the same information whether it will connect to the database or it will be used previous information?
What is the difference between RMI registry and OS Agent?