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
Which characters may be used as the second character of an identifier, but not as the first character of an identifier?
Can I map more than one table in a cmp?
Is infobus easy to use?
What are the different methods of identifying an object?
Which are the different segments of memory?
How to implement dphibernate to activate lazy loading in Flex with java ?thanx in advance!
What is permgen or permanent generation?
What are the purpose of introspection?
Describe responsibilities of Activator?
What is ioc concept & explain it?
What is the difference between long.class and long.type?
How to deploy Jar, War files in J2EE?
Can you give me a simple example of using the requiredif validator rule?
What are the diff types of exception?
What is the difference between system.out ,system.err and system.in?