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

Is there a guarantee of uniqueness for entity beans?

1000


int x=5,i=1,y=0; while(i<=5) { y=x++ + ++x; i=i+2; } System.out.println(x); System.out.println(y); System.out.println(i); How to solve this? Please explain!

1823


What is the relationship between the canvas class and the graphics class?

1040


How would you reatach detached objects to a session when the same object has already been loaded into the session?

1200


What is meant by method chaining?

1141


Explain about RMI Architecture?

1074


Write a singleton program?

1035


How messaging services are done, before release of JMS?

2135


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

972


what is a non-repeatable read?

2411


What are the sequence of steps to write pub or sub model kind of application?

2515


What is jboss?

1031


how to use debug in my elipse to solve problems that exist in my project

2276


Do you think that java should have had pointers?

1046


Can I map more than one table in a cmp?

1076