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

Which component handles cluster communication in jboss?

0 Answers  


What method is used to create the daemon thread?

1 Answers  


Name the class that is used to bind the server object with RMI Registry?

0 Answers  


What happens when a thread cannot acquire a lock on an object?

0 Answers  


whats is mean by connectionpooling

2 Answers   SolutionNET,






difference between applicationserver and webserver

2 Answers   SolutionNET,


What are the benefits of detached objects?

0 Answers  


Is “abc” a primitive value?

0 Answers  


Define the remote interface?

1 Answers  


What is chat area? Explain.

0 Answers  


a US company has filed my H1B visa ,, and i got selected in random number process.I wanna ask Could they ask regarding my languages(java,c++) or there will b just general questions?? And wat kind of questions will they ask in embassy interview??

2 Answers  


how do you Handle Front End Application data against DB with example?

0 Answers   Campus Interaction, HCL,


Categories