If the derived class doesn't want to use methods in base class , derived class can implement the same method in derived class with same signature. For example in the classes given below, DriveType() is implemented in the derived class with same signature. This is called Method Hiding.
class Car { public void DriveType() { Console.WriteLine("Right Hand Drive"); } } class Ford : Car { public void DriveType() { Console.WriteLine("Right Hand "); } }
thanks for providing sir, please make article onc programming examples with output
ReplyDelete