Which of the below given option are true about the following code?
public class A
public int x = 20;
public class B:A
public int x = 30;
C# compiler throws an error.
C# compiler throws a compilation warning.
CLR will throw an Exception when the object of B class is created.
None of the options are correct.
In the given code class B is hiding the class A's member , since class B is also creating variable "x" which is already there in class "A".
Back To Top