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
How can I get the ascii code for a character in c#?
What is difference between ienumerable and list in c#?
Can abstract class have constructor?
Why ienumerable is used in c#?
Explain nullable types in c#?
Why would you use a class property in c#?
how to compare numbers and dispaly the largest ? *first thing I wanted to do is to input how many numbers to be compared *and then analyzed the largest then display it.
What is enum in c#?
Is cli same as the clr?
What is a trace and asset? Explain some differences?
What are primitive types in c#?
What is the difference between int and int in c#?
What is difference between array and list?
Define an array?
What is the difference between method and constructor in c#?