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 Remote Interface?

1 Answers  


What is a tasks priority and how is it used in scheduling?

0 Answers  


What are the diff types of exception?

0 Answers  


Will the general public have access to the infobus apis?

0 Answers  


what are memory considerations of jsp compares to other web components?

0 Answers   TCS,






what is meant by JRMP?

0 Answers  


Is System.err.println(""Statement"); is execute the output on console . Example: System.err.println("Hello JAVA");

8 Answers  


types of exceptions

1 Answers  


What is the difference between RMI and Socket?

2 Answers  


What is prototype?

0 Answers  


How many times may an objects finalize() method be invoked by the garbage collector?

0 Answers  


How to synchronize jsp page?

1 Answers   Infotech, TCS,


Categories