1.

In C# ____________________(a) Non – virtual or static methods can’t be overridden(b) Non – virtual and static methods only can be overridden(c) Overriding is not allowed(d) Overriding must be implemented using C++ code onlyThe question was posed to me in an interview for internship.This intriguing question comes from Overriding Member Functions topic in section Member Functions & its Types of Object Oriented Programming

Answer»

Right CHOICE is (a) NON – virtual or STATIC methods can’t be OVERRIDDEN

Easiest explanation - The non-virtual and static methods can’t be overridden in C# language. The restriction is made from the language implicitly. Only the methods that are abstract, virtual or OVERRIDE can be overridden.



Discussion

No Comment Found

Related InterviewSolutions