A class is a template for creating an object. The class from which other classes derive fundamental
functionality is called a base class.
The class which derives functionality from a base class is called a derived class.
For e.g.
functionality is called a base class.
The class which derives functionality from a base class is called a derived class.
For e.g.
public class X { private int a, b; public X() // constructor { a = 0; b = 0; } public int A { get { return a; } set { a = value; } } public int B { get { return b; } set { b = value; } } }
In above example Class Y derives from Class X, then Class X is a base class and Class Y is the derived class.public class Y : X { private System.Drawing.Color screenColor; public Y() // constructor { screenColor = System.Drawing.Color.Red; } public System.Drawing.Color ScreenColor { get { return screenColor; } set { screenColor = value; } } }
No comments:
Post a Comment