MCQOPTIONS
Saved Bookmarks
| 1. |
Select the correct output for the given set of 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 |
| D. | Compile Time error |
| Answer» D. Compile Time error | |