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 / sahdev singh

True - First time we are comparing only values.
True - Second time also we are comparing only values.
False - We are comparing reference of two objects.

Is This Answer Correct ?    9 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between a Private Assembly and a Shared Assembly

511


What is the purpose of reserved word using in c#?

499


Why do we use hashtable in c#?

477


What are console applications used for?

478


In which format you can pass the value in the sleep function?

541






What is an argument in c#?

471


What is the difference between and xml documentation tag?

519


Why abstraction is used in c#?

499


Why References are stored on heap and variables on stack?

501


Why c# is type safe?

522


What is delegates and events?

470


In how many ways you can overload a method?

582


What’s thread.sleep() in threading ?

505


What does static mean in c sharp?

570


What are virtual classes in c#?

527