What will be output of following program?
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();
}
}

 Posted by Rajeshatkiit on 12/16/2015 | Category: C# Interview questions | Views: 1027 | Points: 40
Select from following answers:
  1. "Derived:rajesh", Base
  2. Base,"Base:rajesh"
  3. Derived, "Derived:rajesh"
  4. Base, "Derived:rajesh"
  5. All Above

Show Correct Answer


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response