adplus-dvertising
frame-decoration

Question

Choose the correct output of the following code snippet?
interface i1
 {
     void f1();
 }
 interface i2 :i1
 {
     void f2();
 }
 public class maths :i2
 {
     public void f2()
     {
         Console.WriteLine("fun2");
     }
     public void f1()
     {
         Console.WriteLine("fun1");
     }
 }
 class Program
 {
     static Void Main()
     {
         maths m = new maths();
         m.f1();
         m.f2();
     }
 }

a.

fun2

b.

fun1

c.

fun1
fun2

d.

fun2
fun1

Answer: (c).fun1
fun2

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Choose the correct output of the following code snippet?