Q:
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
View answer
Workspace
Report Error
Discuss