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

Explain Object Serialization and it can be used?

3 Answers   Infosys,


difference between sql exception class and sql warning class

1 Answers  


What are the implicit objects?

2 Answers   HCL,


what is Static binding?

2 Answers   Wipro,


A user of a web application sees a jsessionid argument in the URL whenever a resource is accessed. What does this mean? a. The form must have the field jsessionid b. URL rewriting is used as the session method c. Cookies are used for managing sessions

0 Answers  






How to determine applet?s height and width?

1 Answers  


java is fully object oriented languages or not? why?

12 Answers   HCL,


What is the difference between the ‘font’ and ‘fontmetrics’ class?

0 Answers  


Are enterprise beans allowed to use thread.sleep()?

0 Answers  


What is the priority of Garbage collector thread?

3 Answers  


What is the purpose of the wait() method?

0 Answers  


the use of try and ffinally keyword

1 Answers  


Categories