C Sharp (C#) - Inheritance
Which of the following is the correct syntax to override a virtual method named
Display in a derived class?Display in a derived class?override before the method signature.public void Display() { } lacks the override keyword, public virtual void Display() { } incorrectly uses virtual in the derived class, and public new void Display() { } hides the base method but doesn't override it for polymorphism.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions