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 default constructor c#?
What is returned if you pass the value 12.34 to the parsefloat () function?
Is it possible to inline assembly or il in c# code?
What is jagged array?
What is the use of static in c#?
Explain dataset.acceptchanges method in .net?
How to override a function in c#?
What is Co- and Contra-Variance in C#?
Do events have return type c#?
Is .net and c# the same?
How long does a loop recorder procedure take?
what is IFormatable
Is there a way of specifying which block or loop to break out of when working with nested loops?
What is ildasm and obfuscator in net?
Which property of the textbox cannot be changed at runtime?