MCQOPTIONS
Saved Bookmarks
| 1. |
Which of the following statements should be added to the subroutine fun( ) if the C#.NET code snippet given below is to output 9 13? class BaseClass { protected int i = 13; } class Derived: BaseClass { int i = 9; public void fun() { // [*** Add statement here ***] } } |
| A. | <i class="csharp-code">Console.WriteLine(base.i + " " + i);</i> |
| B. | <i class="csharp-code">Console.WriteLine(i + " " + base.i);</i> |
| C. | <i class="csharp-code">Console.WriteLine(mybase.i + " " + i);</i> |
| D. | <i class="csharp-code">Console.WriteLine(i + " " + mybase.i);</i> |
| E. | <i class="csharp-code">Console.WriteLine(i + " " + this.i);</i> |
| Answer» C. <i class="csharp-code">Console.WriteLine(mybase.i + " " + i);</i> | |