Q213
What will be the output of the following C# code? class sample public int i; void display() Console.WriteLine(i); class sample1 : sample public int j; public void display() Console.WriteLine(j); class Program static void Main(string[] args) sample1 obj = new sample1(); obj.i = 1; obj.j = 2; obj.display(); Console.ReadLine();
A.
1
B.
3
C.
2
AnswerD.
Compile Time error
Answer: Option C
Solution
Answer: Option C
No explanation is given for this question Let's Discuss on Board