MCQs>IT & Programming>C#>What is the result of the following code ? interface IFoo1 { void meth1(); } interface IFoo2 { void meth1(); } public class f : IFoo1, IFoo2 { void IFoo1.meth1() { Console.WriteLine("Hi1"); } void IFoo2.meth1() { Console.WriteLine("Hi2"); } public void meth1() { Console.WriteLine('Hi3'); } void Main() { IFoo1 f1 = new f(); IFoo2 f2 = new f(); f f3 = new f(); f1.meth1(); f2.meth1(); f3.meth1(); }
C# MCQs
What is the result of the following code ? interface IFoo1 { void meth1(); } interface IFoo2 { void meth1(); } public class f : IFoo1, IFoo2 { void IFoo1.meth1() { Console.WriteLine("Hi1"); } void IFoo2.meth1() { Console.WriteLine("Hi2"); } public void meth1() { Console.WriteLine("Hi3"); } void Main() { IFoo1 f1 = new f(); IFoo2 f2 = new f(); f f3 = new f(); f1.meth1(); f2.meth1(); f3.meth1(); }
Answer
Correct Answer: Hi1 Hi2 Hi3
Explanation:
Note: This Question is unanswered, help us to find answer for this one