Inheritance Advantages and Disadvantages

Advantages:-
 
One of the key benefits of inheritance is to minimize the amount of duplicate code in an application by sharing common  code amongst several subclasses. Where equivalent code exists in two related classes, the hierarchy can usually be  refactored to move the common code up to a mutual superclass. This also tends to result in a better organization of  code and smaller, simpler compilation units.

Inheritance can also make application code more flexible to change because classes that inherit from a common  superclass can be used interchangeably. If the return type of a method is superclass

Reusability -- facility to use public methods of base class without rewriting the same
Extensibility -- extending the base class logic as per business logic of the derived class
Data hiding -- base class can decide to keep some data private so that it cannot be altered by the derived class

Overriding--With inheritance, we will be able to override the methods of the base class so that meaningful  implementation of the base class method can be designed in the derived class.
 
Disadvantages:-
 
1.One of the main disadvantages of inheritance in Java (the same in other object-oriented languages) is the increased  time/effort it takes the program to jump through all the levels of overloaded classes. If a given class has ten levels of  abstraction above it, then it will essentially take ten jumps to run through a function defined in each of those classes

2.Main disadvantage of using inheritance is that the two classes (base and inherited class) get tightly coupled.
This means one cannot be used independent of each other.

3. Also with time, during maintenance adding new features both base as well as derived classes are required to be  changed. If a method signature is changed then we will be affected in both cases (inheritance & composition)

4. If a method is deleted in the "super class" or aggregate, then we will have to re-factor in case of using that  method.Here things can get a bit complicated in case of inheritance because our programs will still compile, but the  methods of the subclass will no longer be overriding superclass methods. These methods will become independent  methods in their own right.

People who read this post also read :



128 comments:

Thanks a lot for this so detailed and useful piece of knowledge, this question arise many times in mind. And helpful for learners .

This article is really very interesting and effective. I think its must be helpful for us.

Inheritance in Java

The process of obtaining the data members and methods from one class to another class is known as inheritance. Inheritance is one of the important features of object-oriented programming.

this is very essential Inheritance Advantages and Disadvantage information to be share with us. i m so much appreciate.

small business grow consultant in uk | small business money investment consultant in uk

Nice post! There are many services, features, and functions offered by professional marketing consultants allowing you to pick the options that work best for you and your business. Thanks.


small business grow consultant in uk | small business money investment consultant in uk


I hope the advantages of PHP never decrease until creation of websites gone from the IT world. Thanks for taking your own time to discuss about the topic.
Regards,
PHP Training in Chennai|PHP Course in Chennai

Your article about software testing is awesome. It helped me to understand the career prospects in software testing industry.
Regards,
Software testing training | Software training | Software testing training in Chennai

I like your collection, thanks for sharing this wonderful collection of themes with us.i am working in Erp Development Companies In India

Thank you for sharing wonderful collections, Plz visit us: web-based-erp-development-india

Thanks Admin for sharing such a useful post, I hope it’s useful to many individuals for whose looking this precious information to developing their skill.
Regards,
DOT NET Training in Chennai|DOT NET Training Institute in Chennai

Inheritance is the pretty concepts in programming, thanks for sharing this advantages.
Regards,
Hadoop Training in Chennai|Big Data Training in Chennai|Best Hadoop Training in Chennai

Very informative!
For more related information visit us. ERP Software.

This is my first visit to your blog, your post made productive reading, thank you. dot net training in chennai

This is my first visit to your blog, your post made productive reading, thank you.
sas training in chennai

This is my first visit to your blog, your post made productive reading, thank you.
mvc training in chennai

!!!!!This is very importent information for us.I like all content and information.I have read it.You know more about this please visit again.
oracle training in chennai

Thank you so much for the clear explanation and detailed analysis of all main advantages and disadvantages of inheritance, I think it's very useful topic for everyone who is interested to make application code more flexible to change and many other things :)

Looking for the Best Datastage Training in Chennai? click to Visit our HTML tutorial

Very informative article.Thank you author for posting this kind of article .



http://www.wikitechy.com/view-article/simple-program-for-multiple-inheritance-using-cpp-with-example



Both are really good,
Cheers,
Venkat

Very informative article.Thank you author for posting this kind of article .


http://www.wikitechy.com/view-article/multilevel-inheritance-program-in-cpp-with-example



Both are really good,
Cheers,
Venkat


We are the Top Escorts Providers in Allover India. Bangalore Escorts, Chennai Escorts, Escorts in Chennai are Available in our Female Escorts Agency.

Wonderful blog.. Thanks for sharing informative blog.. its very useful to me..

iOS Training in Chennai

Wonderful blog.. Thanks for sharing informative blog.. its very useful to me..

iOS Training in Chennai

This is really nice blog. Contents over here are so informative too. For more in this topic, visit here.. Inheritance – Feature of Object Oriented Programming (OOP)

Very helpful and good material for everyone who’s want to self learn. Types of Inheritance in Java

Nicz.I need some tips related to your content..I am working in ERP In Dubai

perfect explanation about Inheritance Advantages and Disadvantages..java training in chennai

No java doesn't support multiple inheritance directly .Yes indirectly you can use the concept of multiple inheritance in java by implementing interface . While implementing interface you can implements any number of interface and can also extends one base class which will indirectly work as an multiple inheritance.

java training in chennai

Great post with very useful information to all thanks for sharing with all of us
buy wireless keyboard online | buy wired keyboard online

You post explain everything in detail and it was very interesting to read. Thank you. nata coaching centres in chennai



Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more .
java training in chennai

Thanks for Sharing this great article..Its really nice and useful for us… Technology Company in Chennai

Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more .
java training in chennai

There are multiple organizations which are expert in ERP software developer in India.
ERP Software developer India

Hey nice work! I really appreciate your article and your effort made.. Technology Company in Chennai

ERP and the high availability of innovative ERP developer in India...
ERP Software developer India

Thanks for Sharing this great article..Its really nice and useful for us… keep sharing.. Technology Company in Chennai

I have visited this blog for the first time. but really very good information. thanks for sharing all the good stuff. Technology Company in India

You explain the things very well..Thanx for sharing such article!
Real Estate Marketing Software

Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ..Best PHP Training in Chennai|PHP Training in Chennai

Hey nice work! I really appreciate your article and your effort made.. Technology Company in Chennai


This post is really nice and informative. The explanation given is really comprehensive and informative..

Testing Training with Live Project

great article. Thanks for sharing java Inheritance advantages and disadvantages .its really helpful for me.java is the one of the most programming language build up on api....keep sharing on updated java tutorials?

The article is very interesting and truly informative. Thanks for sharing the information on the blog. Web hosting company in Chennai

I may be crazy but, the idea has been nagging me for some time that perhaps the biggest favor we could do for the African poor would be to kill off all that dangerous wild life.
Best PHP Training in Gurgaon


Overriding--With inheritance, we will be able to override the methods of the base class so that meaningful implementation of the base class method can be designed in the derived class.
java training in chennai | java training

Code reuse using subclass and super class relationship. Subclass inherits all the members (fields, methods, and nested classes) from its superclass.
Very informative ..i suggest this blog to my friends..Thank you for sharingjava training in chennai | chennai's no.1 java training in chennai | best java institute in chennai

Great Blog...ERP Software System is capable to simplify the time-consuming procedures of a real estate company.

This comment has been removed by the author.
This comment has been removed by the author.

perfect explanation about java programming .its very useful.thanks for your valuable information.java training in chennai | java training in velachery

This comment has been removed by the author.

Hi,
Your article is really nice. That is so logical and clearly explained. I will follow up your blog for the future post. Thanks for sharing.
Regards,
Anjali,
Best Java Online Training in Hyderabad, India

perfect explanation about java programming .its very useful.thanks for your valuable information.java training in chennai | java training in velachery

This comment has been removed by the author.

I have read your blog completely and i got a very useful information from your blog.You have done a great job . Thanks for sharing this information.


Python Training in Chennai

perfect explanation about java programming .its very useful.thanks for your valuable information.java training in chennai | java training in velachery

This comment has been removed by the author.

I just see the post i am so happy to the communication science post of information's.So I have really enjoyed and reading your blogs for these posts.Any way I’ll be replay for your great thinks and I hope you post again soon...
Java Training in Chennai

Nice Blog.. It's help to all.
For more related information visit us.
ERP Software Solution

Informative article, just what I was looking for.seo services chennai

Such a great articles in my carrier, It's wonderful commands like easiest understand words of knowledge in information's.
PHP Training in Chennai

I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Data Science with SAS Training, kindly contact us http://www.maxmunus.com/contact
MaxMunus Offer World Class Virtual Instructor led training on TECHNOLOGY. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
For Demo Contact us.
Sangita Mohanty
MaxMunus
E-mail: sangita@maxmunus.com
Skype id: training_maxmunus
Ph:(0) 9738075708 / 080 - 41103383
http://www.maxmunus.com/

First You got a great blog .I will be interested in more similar topics. i see you got really very useful topics , i will be always checking your blog thanks. font face generator

With the demise of the Google Page Rank Toolbar, TRUST FLOW is the now the most important metric in SEO. Since 2013 Go-ogle has stopped publicly updating Page Rank, making high PR links worthless. Trust Flow has now takes its place and it shows the real authority that passes to your website, so your website gets rankings improvements on Go0gle pretty fast! High Trust Flow Backlinks


This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharng this information,this is useful to me...
Android training in chennai



This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharng this information,this is useful to me...
Ios training in chennai

This comment has been removed by the author.

This is the first visit of your website. I read your blog very clearly. This will help me to understand the concepts in java, want to learn Android developement.



Android Training in Chennai

Good blog. Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information.

Thanks for sharing..,


Core Java Online Training


It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
Android Training in Chennai
Ios Training in Chennai

It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
Android Training in Chennai
Ios Training in Chennai

Wow, that was not only an interesting but also an educative article inheritance advantage and disadvantage. I have learned a lot from the article and the comments posted by other members of this forum and I will not mind visiting this site occasionally to read both new and old articles. In case you need urgent proofreading services, feel free to visit our site by clicking on Re-structuring Help

I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.

Android App Development Company

It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
Android Training in Chennai
Ios Training in Chennai

Pretty section of content. I simply stumbled upon your site and in accession capital to say that I get actually loved to account your blog posts.
Python Training in Chennai


I am expecting more interesting topics from you. And this was nice content and definitely it will be useful for many people.

Android App Development Company

It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
Android Training in Chennai
Ios Training in Chennai

Nice info about Php it’s reallyhelpful…. If it possible share some more tutorials……….

great and nice blog thanks sharing..I just want to say that all the information you have given here is awesome...Thank you very much for this one.
web design Company
web development Company
web design Company in chennai
web development Company in chennai
web design Company in India
web development Company in India

I am expecting more interesting topics from you. And this was nice content and definitely it will be useful for many people.
iOS App Development Company
iOS App Development Company

I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.

Fitness SMS
Fitness Text
Salon SMS
Salon Text
Investor Relation SMS
Investor Relation Text

Thanks a lot! You made a new blog entry to answer my question; I really appreciate your time and effort.
java training in velachery |
best java training in velachery

This blog is the general information for the feature. You got a good work for this blog.We have a developing our creative content of this mind.Thank you for this blog. This for very interesting and useful.Selenium Training Institutes in Chennai | Best Selenium Training in Chennai

it is really amazing...thanks for sharing....provide more useful information...
Mobile app development company

Hi there! Nice article. Inheritance is the procedure of deriving property from parent class. It Allows the code to be reused as many times as needed. It Save the time and effort as the main code need not be written again. Inheritance used into Web Development for better Development. If You want to know about Web Development trends you can check out this article.

Hi, thanks for sharing this article, it's been very helpful.
I'm a happy user of an erp system, Microsoft Dynamics. Since I got it, being a manager got much easier, and our results rose significantly just after a few months. Check out my website if you would like to know more!

Nice post. Thanks for sharing and providing relevant information. this is really useful.
IT Company in Lucknow

Thanks a lot! You made a new blog entry to answer my question; I really appreciate your time and effort.
best java institute in chennai |
java training institutes in chennai

great and nice blog thanks sharing..I just want to say that all the information you have given here is awesome...Thank you very much for this one.

White Label Website Builder

Nice blog..! I really loved reading through this article... Thanks for sharing such an amazing post with us and keep blogging...
ios app development course

I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon. Java Training in Chennai
| Software Testing Training in Chennai

great and nice blog thanks sharing..I just want to say that all the information you have given here is awesome...Thank you very much for this one.
web design Company
web development Company
web design Company in chennai
web development Company in chennai
web design Company in India
web development Company in India

Thanking you for given this information.I very much enjoyed this article.php jobs in hyderabad.

Being new to the blogging world I feel like there is still so much to learn. Your tips helped to clarify a few things for me as well as giving..
Texting API
Text message marketing
Digital Mobile Marketing
Sms API
Sms marketing

Great blog created by you. I read your blog, its best and useful information. You have done a great work. Super blogging and keep it up.php jobs in hyderabad.

Great blog created by you. I read your blog, its best and useful information. You have done a great work. Super blogging and keep it up.php jobs in hyderabad.

nice blog. thanks for sharing valuable information. It’s really good.Any one looking software courses nareshit is the best offline and online software training institute in Hyderabad and Chennai.

Thanks for sharing this informative news with us. Keep updating. php training institute in chennai

She knows the needs of the males very well and keeps herself updated in order to meet the expectation of each and every customer whether in the city or out of the city.


Chennai Escort
Chennai Escorts
Chennai Escorts Agency
Chennai Escorts Service
Escorts in Chennai
Independent Escorts in Chennai

Hi Dear,

i Like Your Blog Very Much..I see Daily Your Blog ,is A Very Useful For me.

ERP Software

Finden das neueste erp software in Germany. Wir bieten komplette lösung für volle kontrolle von deinem geschäft management @ software-im-unternehmen.de.

Visit Now - http://software-im-unternehmen.de/erp-software/

Good work sir, Thanks for the proper explanation about Inheritance . I found one of the good resource related JAVA and OOPS concepts. It is providing in-depth knowledge on JAVA and OOPS. which I am sharing a link with you where you can get more clear on JAVA and OOPS. To know more Just have a look at this link

Java Tutorial
Class and object
Inheritance
Polymorphism
Abstraction
Encapsulation

Hi, i have some questions in inheritances , now cleared about that, thank you for share this post
web designing class

I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more

posts like this one.

Webdesign Lüdenscheid

Thank you so much for sharing the inheritance advantages "To minimize the amount of duplicate code in an application by sharing common code among st several sub classes" This is one of the important point to be shared and well it has the data to be given as specific sub oriented subject. As I completed my PMP in Kuwait I was having enough knowledge on Inheritance, Well Thank you for sharing the advantages I hope to see more number of Updates from you

Thanks for sharing information about database development.
Database Development Services in India

This comment has been removed by the author.

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training India . Nowadays Java has tons of job opportunities on various vertical industry.

Your website content nice nice and interesting to observe.
office 2013 professional plus key deutsch

I was looking for this kind of information that I received from here..

Nice article, I loved it. Thanks for sharing and keep sharing.
personalrekrutierung

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More