Hello EveryOne,
Abstract Classes
This Concept Is Associated With Inheritance.
It Includes Only Basic Functionality.
It Is Used To Define Base Or Parent Or Super Class In Class Hierarchy.
Abstract Class Cannot Be Instantiated.That means We Cannot Create Object Of the Abstract Class.
How We Access The Functionality Of Abstract Class????
Answer Is:---By Making One Or More Child Classes Of Abstract Class.
Abstract Class Contains Abstract And Non Abstract Methods.
Abstract Methods Are The`Methods With No Body..That Means Only Declaration Is`There.But
No Definition.So Definition Is Provided By Child Classes Of Abstract Class.
And It Is Mandatory.Otherwise Compile Time Error Will Be Generated.
Non-Abstact Methods Are The Methods With Body.
So they Directly pass from Abstract Class to child classes.
Some Important Points About Abstract Classes:
1>Abstract Class Cannot Be Prefixed With Sealed Keyword.As Sealed Keyword Avoids Inheritance.
2>The Purpose Of An Abstract Class Is To Provide A Common Definition Of A Base Class That Multiple Derived Classes Can Share.
3>Need Of Abstract Class Is To Provide Default Behaviors As Well As Common Behaviors That Multiple
Derived Classes Can Share And Override.
4>An Abstract Method Cannot Be Private.
Abstract Classes
This Concept Is Associated With Inheritance.
It Includes Only Basic Functionality.
It Is Used To Define Base Or Parent Or Super Class In Class Hierarchy.
Abstract Class Cannot Be Instantiated.That means We Cannot Create Object Of the Abstract Class.
How We Access The Functionality Of Abstract Class????
Answer Is:---By Making One Or More Child Classes Of Abstract Class.
Abstract Class Contains Abstract And Non Abstract Methods.
Abstract Methods Are The`Methods With No Body..That Means Only Declaration Is`There.But
No Definition.So Definition Is Provided By Child Classes Of Abstract Class.
And It Is Mandatory.Otherwise Compile Time Error Will Be Generated.
Non-Abstact Methods Are The Methods With Body.
So they Directly pass from Abstract Class to child classes.
Some Important Points About Abstract Classes:
1>Abstract Class Cannot Be Prefixed With Sealed Keyword.As Sealed Keyword Avoids Inheritance.
2>The Purpose Of An Abstract Class Is To Provide A Common Definition Of A Base Class That Multiple Derived Classes Can Share.
3>Need Of Abstract Class Is To Provide Default Behaviors As Well As Common Behaviors That Multiple
Derived Classes Can Share And Override.
4>An Abstract Method Cannot Be Private.
