difference of inheritance and interface

Answers were Sorted based on User's Feedback



difference of inheritance and interface..

Answer / anandhi

INHERITANCE:diriving new class from existing class...
types: single ,multiple,....etc.
its nt support multilevel inhertance...
so we can use interface....

Is This Answer Correct ?    7 Yes 2 No

difference of inheritance and interface..

Answer / 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

difference of inheritance and interface..

Answer / prabha

interface can extend only once but implement more
inheritance can extend more time

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More Advanced Java Interview Questions

What is the immediate superclass of the applet class?

0 Answers  


Why use a datasource when you can directly specify a connection details? (in a J2EE application)

1 Answers  


what is the RMI / IIOP?

3 Answers  


Is it possible to stop the execution of a method before completion in a sessionbean?

0 Answers  


What is in-memory replication?

0 Answers  






In RMI, inorder to sent the stub reference to the client, is we have to load the server object first into the memory or can we directly sent reference to the client?

0 Answers  


whats is mean by class.forName() whats the return type of class

6 Answers   SolutionNET,


Difference Between java & javax

5 Answers   Sun Microsystems, Wipro,


JMS based on what technology?

1 Answers  


Why does the option tag render selected=selected instead of just selected?

0 Answers  


Difference between new operator and class.forname().newinstance()?

0 Answers  


what is activation monitor and what is its job?

1 Answers  


Categories