Generalization and Specialization in C# | Generalization and Specialization in CSharp with Examples

Опубликовано: 04 Октябрь 2024
на канале: Dot Net Tutorials
440
8

Generalization and Specialization in C# | Generalization and Specialization in CSharp with Examples
In this video, I am going to discuss Generalization and Specialization in C# with Examples. This is a very interesting topic that is generalization vs specialization. This is related to inheritance. Let us understand what you mean by Generalization and Specialization in C# with some Examples.

Generalization and Specialization in C#
So, the point that you need to remember is both generalization and specialization achieve using only inheritance. We have seen four examples in which 2 are of specialization and 2 are of generalization. In specialization, the parent was existing and the child was defined later. In generalization, the child class was existing then we define the base class. So, specialization is a top-down approach and generalization is a bottom-up approach.

In specialization, the base class has something to give to the child class whereas, in generalization, the base class doesn’t have anything to give to their child classes. Just their purpose is to group them together so that we can easily manage all those things.

The purpose of generalization is to achieve polymorphism and the purpose of specialization is to share its features with its child classes.

So, there are two purposes of inheritance. One is to share features with child classes and the second one is to achieve polymorphism. So here I have given you a clear idea of what is a specialization and what is a generalization.

The text document of this video: https://dotnettutorials.net/lesson/ge...

#dotnettutorials #csharptutorials #generalizationspecializationcsharp #generalizationcsharp #specializationcsharp #generalizationcsharpexamples #specializationcsharpexamples

Generalization and Specialization in C#
Generalization and Specialization in C# with Examples
Generalization and Specialization in CSharp
Generalization and Specialization in CSharp with Examples
C# Generalization and Specialization
C# Generalization and Specialization Examples
CSharp Generalization and Specialization
CSharp Generalization and Specialization Examples
Generalization in C#
Generalization C# with Examples
Generalization in CSharp
Generalization in CSharp with Examples
Specialization in C#
Specialization in C# with Examples
Specialization in CSharp
Specialization in CSharp with Examples