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
Is there a guarantee of uniqueness for entity beans?
int x=5,i=1,y=0; while(i<=5) { y=x++ + ++x; i=i+2; } System.out.println(x); System.out.println(y); System.out.println(i); How to solve this? Please explain!
What is the relationship between the canvas class and the graphics class?
How would you reatach detached objects to a session when the same object has already been loaded into the session?
What is meant by method chaining?
Explain about RMI Architecture?
Write a singleton program?
How messaging services are done, before release of JMS?
What is a session? Can you share a session object between different theads?
what is a non-repeatable read?
What are the sequence of steps to write pub or sub model kind of application?
What is jboss?
how to use debug in my elipse to solve problems that exist in my project
Do you think that java should have had pointers?
Can I map more than one table in a cmp?