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 / manoj yadav
1.TRUE... here we only comparing two value. if it is true.
then it wil execute (1==1).
2. TRUE.. here first we convert the int value in to string.
as bothe value are same so converted value wl also same
string so
3. WRONG..here we first give a reference to object. as
bothe objects reference cant be same so FALSE
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is private variable?
What is oledbconnection c#?
What is static and use of it?
What is visual c# net?
What is the .NET collection class that allows an element to be accessed using a unique key?
What is namespace give the example?
What is remote data?
What is array and arraylist?
Describe a Struct ?
What is data dictionary in c#?
What is difference between singleordefault and firstordefault?
Is c# pass by reference?
Why is c# used?
What is data binding with example?
What is generic collection in c#?