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

Why dependency injection is used in c#?

565


What is deadly diamond problem?

631


What is data type in c# with example?

611


Explain about Error handling and how this is done

620


What is a thread c#?

587






What is the difference between finalize() and dispose()?

575


What is the size of a decimal?

707


Why do we use classes?

576


What is an escape sequence? Name some string escape sequences in c#.

601


What is asynchronous one-way calls?

621


What is Co- and Contra-Variance in C#?

620


What is static classes in c#?

606


How garbage collection deals with circular references.

541


What are verbatim strings in c#?

577


What is different between Boxing and Unboxing?

666