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 long does it take to learn c# for unity?
What is difference between singleordefault and firstordefault?
How can we make a thread sleep for infinite period ?
How many types of delegates are there in c#?
What is the difference between string and string in c#?
Can a class have more than 1 destructor?
What is the difference between CreateObject() and GetObject()?
What is the c# equivalent of c++ catch (...), Which was a catch-all statement for any possible exception?
What is difference between mutable and immutable in c#?
What is concrete class in c#?
What are the steps to create a webservice and consume it?
What is a event in c#?
In which order the constructor is called for an inherited class?
Does google use c#?
How to implement singleton design pattern in c#?