Number of questions 1,751
Number of tests completed 250,977
Number of questions answered 3,748,390
Number of registered users 19,125
Sign In | Register
Skip Navigation Links
Question: using System; sealed class MyClass { public int x; public int y; } class MyDerivedC : MyClass { } class MainClass { public static void Main() { MyClass mC = new MyClass(); mC.x = 110; mC.y = 150; Console.WriteLine("x = {0}, y = {1}", mC.x, mC.y); } } whats the obvious problem?
Answer1: x and y have not been initialized in the base class
Answer2: cant inherit from a sealed class
Answer3: The Console.WriteLine format is incorrect
Answer4: sealed class needs an access modifier
Answer: cant inherit from a sealed class

Explaination: You will get the error message: 'MyDerivedC' cannot inherit from sealed class 'MyBaseC'.
Link: External Explaination

Correctly answered: 25077
Incorrectly answered: 6461
Terms of Use Ver. 2.0.6783.38332