C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |



My Profile

Gifts

Active Members
TodayLast 7 Days more...






Posted By: Akshatha naik       Member Level: Gold       Posted Date: 25 Apr 2008       Category: C#

What will be the output of the following program ?.




. class A
{
public virtual void print()
{
Console.WriteLine("A");
}
}
class B:A
{
public override void print()
{
Console.WriteLine("B");
}
}
class C:B
{
public override void print()
{
Console.WriteLine("C");
}
}
class D:C
{
public override void print()
{
Console.WriteLine("D");
}
}
static void Main(string[] args)
{
D d=new D();
A a=d;
B b=d;
C c=d;
a.print();
b.print();
c.print();
d.print();
Console.ReadLine();
}





Select Answer:

ABCD
DDDD
AABB
CCDD




      
Your Test Score: 0 / 0



Next Question: A default property is called as a
Previous Question: How can you prevent a class from inheriting?
Related Questions:
  • Can we have static indexer in C#?


  • What is diffgram in dataset?


  • .net


  • The Default access specifier for the class members in C# is


  • Events in C# are impltemented using:


  • Categories

    ASP.NET C# VB.NET 
    .NET Framework SQL Server Other 

    Submit Interview/Test Questions with Answers and make money from adsense revenue sharing program

    Want to prepare for an interview? Try our aptitude tests and standard interview questions first.


    dotNet Slackers   BizTalk Adaptors    Web Design

    SPOC

    Contact Us    Privacy Policy    Terms Of Use