1
Reply

Persistent Interview question for experience ?

Rajesh Singh

Rajesh Singh

9y
1.4k
0
Reply

    Q1. What will be output of following program? public class Base{public Base(){Console.WriteLine("Base");}}public class Derived : Base{public Derived(){Console.WriteLine("Derived");}}Public Class Main {static void Main(string[] args) {Derived obj=new Derived()} }Ans: Base ,DerivedQ2. What will be output of following programs?public class Base{public Base(){Console.WriteLine("Base");}public Base(string name){Console.WriteLine("Base: " + name);}}public class Derived : Base{public Derived(){Console.WriteLine("Derived");}public Derived(string s){Console.WriteLine("Derived: " + s);}}class Program{static void Main(string[] args){Derived d = new Derived("rajesh");Console.ReadLine();}}Ans: BaseDerived: rajeshQ3. What will be output of following program?interface IInterface1{void Show();}interface IInterface2{void Show();}class A : IInterface1, IInterface2{public void Show(){throw new NotImplementedException();}}A. Error B. warning C. No Error D. Not possibleAns: No error. It will compile successfully.