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

What class is the top of the awt event hierarchy?

1113


Where can I find seam examples and documentation?

1099


What is the purpose of the finally clause of a try-catch-finally statement?

1036


Define the remote object implementation?

2504


What are callback interfaces?

1094


What is a session? Can you share a session object between different theads?

983


Can I use javascript to submit a form?

1150


What is synchronization and why is it important?

1121


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

1095


Why does the tag url-encode javascript and mailto links?

1010


Why use POJO when I can use hashmap

2653


What is RMI and what are the services in RMI?

1176


How a component can be placed on Windows?

2857


the same information whether it will connect to the database or it will be used previous information?

1043


What is the difference between RMI registry and OS Agent?

1146