Interview Questions

What will be the output of the following code snippet?

ASP.NET and .NET WEB Questions and Answers


(Continued from previous question...)

What will be the output of the following code snippet?

What will be the output of the following code snippet?

using System;
class MainClass
{
static void Main( )
{
new MainClass().Display( 3.56 );
}

private void Display( float anArg )
{
Console.Write( “{0} {1}”, anArg.GetType(), anArg );
}

double Display( double anArg )
{
Console.Write( “{0} {1}”, anArg.GetType(), anArg );
return anArg;
}

public decimal Display( decimal anArg )
{
Console.Write( “{0} {1}”, anArg.GetType(), anArg ); return anArg;
}
}

* System.Single 3.56
* System.Float 3.56
* System.Double 3.56
* System.Decimal 3.56


System.Double 3.56

(Continued on next question...)

Other Interview Questions