Free Inheritance and Polymorphism Tutorial

Feb
10

Inheritance and Polymorphism

Posted by admin

{}class Derived : Base{} The operator �:�is used to indicate that a class is inherited from another class. Remember that in C#, a derived class can�t be more accessible than it�s base class. That means that it is not possible to declare a derived class as public, if it inherits from a private class. For example the following code will generate a compile time error.  class Base{} public class Derived : Base{} In the above case the Base class is private. We try to inherit a public  
continue >>

Tags:

Add A Comment