int i = 1;
int j = 1;
System.Console.WriteLine(i == j);
System.Console.WriteLine(i.ToString() == j.ToString());
System.Console.WriteLine((object)i == (object)j);
Give the sample code above, what is the output to the console?

Answer Posted / sasi

static void Main(string[] args)
{
int i = 1, j = 1;
Console.WriteLine(i + j);
Console.WriteLine("\n" + i.ToString() + j.ToString());
Console.WriteLine("\n"+((object)i==(object)j));
Console.ReadLine();
}
output:-
2
11
false

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the benefit of using interface in c#?

683


What are the fundamental oop concepts?

687


What is difference between constants and read-only?

646


What is the difference between internal and protected in c#?

645


How objects are stored in memory?

685


what is .NET framework architecture ??

1758


What is the example of predicate?

680


What is executescalar in c#?

630


What are primitive data types in c#?

702


What is an assembly qualified name

781


How many constructors can a class have c#?

678


What is _viewstart cshtml?

649


Explain what a diffgram, and a good use for one Define diffgram? How it be used?

735


Explain the difference between abstract class and interface.

835


Define delegate in c#?

707