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

Describe ways of cleaning up objects in c#.

680


What is default value of enum c#?

657


What does void do in unity?

705


Explain the difference between // comments, /* */ comments and /// comments?

681


What do you know about Translate Accelerator?

819


What is the relationship between a process, application domain, and application?

716


Why do you call it a process? What’s different between process and application in .net, not common computer usage, terminology?

758


Explain the difference between passing parameters by value and passing parameters by reference with an example?

698


Is c# good for beginners?

648


what is IEquatable

737


What is an example of delegation?

675


How to use nullable types in .net?

750


In gridview in editmode if we want to display information in one combobox based on

2036


What is Garbage Collection in .Net?

800


What is generic method in c#?

667