C# Inheritance
Inheritance (IS-A): Inheritance is a process in which one object acquires another all the properties and behaviors of its parent object automatically.
- The class which inherits the member of another class is called derived class and the class whose members are inherited is called base class.
- Constructor and struct and destructors are not inherited.
- Multiple inheritance not possible in c# because of the complexities involved where method name can clash when two different class have same method name, this is resolved by pointer in C#.
- Stop Inheritance
1. Make the class as sealed.
2. Add private constructor in the class
Comments
Post a Comment