Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

difference of inheritance and interface

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


Please Help Members By Posting Answers For Below Questions

How a component can be placed on Windows?

2784


What are the different types of exception?

983


Why use POJO when I can use hashmap

2586


What’s jboss jbpm?

963


Do you think that java should have had pointers?

1003


To what value is a variable of the string type automatically initialized?

1078


What is a modular application?

1007


When a thread blocks on i/o, what state does it enter?

1035


How are the elements of a cardlayout organized?

1034


What is the difference between system.out ,system.err and system.in?

1046


Have you used threads in Servelet?

2471


What is RMI and what are the services in RMI?

1073


How task's priority is used in scheduling?

2238


What is metaspace?

967


If your ui seems to freeze periodically, what might be a likely reason?

977