Wednesday, 23 January 2019

What is the syntax to inherit from a class in C#

What is the syntax to inherit from a class in C#?

Answer:

When a class is derived from another class, then the members of the base class become the members of the derived class.
The access modifier used while accessing members of the base class specifies the access status of the base class members inside the derived class.
The syntax to inherit a class from another class In C# is as follows:

class MyNewClass : MyBaseClass

No comments:

Post a Comment