Home / MCQ Bank / Computer
Computer Classes And Objects In C Sharp

What will be the output of the following C# code? interface i1 { void fun(); } interface i2 { void fun(); } public class maths :i1, i2 { void i1.fun() { Console.WriteLine("i1.fun"); } void i2.fun() { Console.WriteLine("i2.fun"); } } class Program { static void Main(string[] args) { Sample obj = new Sample(); i1 i = (i1) obj; i.fun(); i2 ii = (i2) obj; ii.fun(); } }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option D • i1.fun i2.fun

Related Computer Questions

Which of the following expressions can be used to multiply a given number 'a' by 4? What will be the output of the following C code (without linking the source file in which ary1 is defined)? #include <stdio.h> int main() { extern ary1[]; printf("scope rules\n"); } What do you call a collection of records matching parameters of a query? What would be the Prefix notation and Postfix notation for the given equation? A+B+C What will be the step of the interpreter in a jump statement when an exception is thrown?