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
What is xor operator in c#?
What is difference between a constant and read-only in C#?
what is a enumeration in c#
What is the difference between “constant” and “readonly” variables in c#?
How to Show Message box in Metro Style App?
Is c# good for beginners?
Is hashset ordered c#?
Why would you use untrusted verification?
What is use of a HashTable in .NET?
Can a dictionary have duplicate keys c#?
What is the difference between list and arraylist c#?
The int maps to which C# keyword in .NET type?
What is .net console?
Why abstract class can not be instantiated?
Why do we use namespace in c#?