Inheritance

Q1: How can you prevent inheritance from a class in C#.NET ?

A Declare the class as shadows.

B Declare the class as overloads.

C Declare the class as sealed.

D Declare the class as suppress.

E Declare the class as override.

ANS:C - Declare the class as sealed.

C#.NET allows sealed attribute to be used as a part of class statement. Classes declared with sealed keyword cannot be used as based class for other classes. Most important reason to do this world be to prevent behavior of a class to be changed in any way.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.