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


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !



Posted By: Dhyanchandh.A.V       Member Level: Gold       Posted Date: 19 Jul 2005       Category: C#

What is the output of following C# code?




public interface Inter
{
void MyFun();
int MyProp { get; set; }
}
public class AClass:Inter
{
int aField;
public AClass( ){ }
public static void Main()
{
AClass aClass = new AClass();
Console.Write(aClass.MyProp);
aClass.MyFun();
}
void Inter.MyFun( )
{
Console.WriteLine(" MyFun()");
}
public int MyProp
{
get { return aField; }
set { aField = value; }
}
}



Select Answer:

Exception
Syntax Error( aField is not intialised ).
MyFun()
Syntax Error( 'AClass' does not contain a definition for 'MyFun' ).
0 MyFun()



      
Your Test Score: 0 / 0



Next Question: A static constructor can have parameters.True or False.
Previous Question: The File class, representing a file on disk, and the Directory class, representing a directory, are found in which namespace?
Related Questions:
  • A structure in C# can be derived from one or more


  • How are the attributes specified in C#


  • What is the C# equivalent of System.Single


  • For Each statement implicitly implements which interface


  • Is this syntax valid


  • 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


    Contact Us    Privacy Policy    Terms Of Use