Rajesh Singh
Persistent Interview question for experience ?
By Rajesh Singh in C# on Nov 14 2015
  • Rajesh Singh
    Nov, 2015 14

    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.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS