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...

whats is inheritance?

Answer Posted / mukthiyar

Inheritance is a Reusable of the existing code.

There are two types of Inheritance implementation
Inheritance and interface Inheritance.

Implementation inheritance promotes reusability but improper
use of class inheritance can cause programming nightmares by
breaking encapsulation and making future changes a problem.
With implementation inheritance, the subclass becomes
tightly coupled with the superclass. This will make the
design fragile because if you want to change the superclass,
you must know all the details of the subclasses to avoid
breaking them. So when using implementation inheritance,
make sure that the subclasses depend only on the behavior of
the superclass, not on
the actual implementation.

Interface inheritance promotes the design concept of program
to interfaces not to implementations. This also reduces the
coupling or implementation dependencies between systems. In
Java, you can implement any number of interfaces. This is
more flexible than implementation inheritance because it
won’t lock you into
specific implementations which make subclasses difficult to
maintain. So care should be taken not to break the
implementing classes by modifying the interfaces.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a boolean in java?

1002


How do you override a method?

957


What is a java predicate?

914


When parseint method can be used?

892


What are register variables what are the advantages?

864


What is difference between c++ and java ?

1073


What is exception hierarchy in java?

963


Can a private method of a superclass be declared within a subclass?

959


What are daemon Threads in java?

1128


What is generics in java interview questions?

1001


What are the advantages of inner classes?

946


What is return type in java?

1010


What are the restriction imposed on a static method or a static block of code?

996


Explain some best practices you would apply while using collection in java?

980


How can we achieve thread safety in java?

1085