CrazyEngineers Archive
Old, but evergreen and popular discussions on CrazyEngineers, presented to you in read-only mode.
@Ankita Katdare • 14 Oct, 2010
I have a subject called "Object Oriented Methodologies".
In this, I frequently come across these two terms: Generalization and Inheritance.

But, the difference between the 2 is not clearly mentioned anywhere.

Can anybody solve this query?
Please provide an example for the same.
@Morningdot Hablu • 14 Oct, 2010 • 1 like If you talk about furit and mango.You can say that fruit is a generalized class of mango.
Where all the mango properties defined a fruit.
But if you talk about mosambi and orange it would be an example of inheritance.Where some properties are extended you may extend the whole properties also.
ya fruit and mango is also an example of inheritance.
So you can say that every generalization example is an example of inheritance but reverse is not true.
Correct me if i am wrong..!
@Karshil Sheth • 26 Jan, 2020 • 2 likes

Generalization is the term that we use to denote abstraction of common properties into a base class in UML. When we implement Generalization in a programming language, it is called Inheritance. So, Generalization and Inheritance are same, the terminology just differs depending on the context where it is being used . It is used for top-down programming and we know all the attributes and things of the project before hand.

@Durgesh Srivastava • 29 Jan, 2020

Inheritance is the process of creating a new classes from an existing class. The Pre-existing class is called base class or super class and the new class is knows as derived class or subclass.Inheritance allows the extension and reuse of existing code, without having to repeat or rewrite the code from scratch 

When we create a base/super class from two or more similar type of objects by extracting their all  common characteristics(attributes and behavior) and combine them, then this process is known as Generalization.

@Swarup Pan • 30 Jan, 2020

In case of Object Oriented Programming, generalization is like to sum up or rather bundle up several functions or methods to a single type or group.

Inheritance is a very useful property of OOP.

If you have declared a parent class and wrote some functions or methods in that class its accessable in that class. Now you make another class and you make it a child class of the previously written class. Now the later written class is a child of the previous class.

Now the later written class can directly use the functions or methods written in the 1st one without being written again in the 2nd class.


Related Posts

@Naveen08 · Sep 5, 2008

Hi to all.. I am Naveen, i am an EEE student and i would like to know the titles for the mini projects in electrical............

@Kaustubh Katdare · Mar 7, 2014

Every year, tens of thousands of students from all over the world visit CrazyEngineers to look for project topics and project ideas for their final or third year academic submissions....

@vvishwaskumar · Nov 19, 2009

hi i have a bicycle having a load of 100 kg acting on it. I have to calculate the starting torque, to propell the bicycle, either on the wheel or...

@Ankita Katdare · Jan 11, 2015

TATA Sky is undoubtedly one of the biggest and most popular Direct-To-Home (DTH) operators in India and the company is stepping up the game by introducing a Tata Sky 4K...

@Ankita Katdare · Jan 27, 2014

Suzuki Motorcycle India Limited, the Indian subsidiary of Suzuki Motor Corporation, Japan has launched a new premium 150cc bike with Suzuki Gixxer - a motorcycle that is targeted at the...