Answers for "c# class method overriding"

C#
2

c# class method overriding

class Class1{
  public virtual void display(){
    Console.WriteLine("Super Class");
  }
}

class Class2:Class1{
  public override void display(){
    Console.WriteLine("Sub Class");
  }
}

static void Main(String[] args){
	Class2 obj = new Class2();
    obj.display();
}
Posted by: Guest on August-22-2021

Code answers related to "c# class method overriding"

C# Answers by Framework

Browse Popular Code Answers by Language