Junior From PDF OOP C# OOP

What is the difference between new and override in inheritance?

  • override → Overrides a virtual method in base class (runtime polymorphism).
  • new → Hides a base class method (compile-time hiding, not true overriding).
class Vehicle { public void Start() => Console.WriteLine("Vehicle");
}
class Car : Vehicle { public new void Start() =>

Console.WriteLine("Car"); }

More from C# Programming Tutorial

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details