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
Why do canadians say zed?
What does firstordefault mean in c#?
Is c# a keyword?
Why do we need abstract class?
What language is c# similar to?
What is the resgen.exe tool used for?
What is a property c#?
Is typeof c#?
List some of the common data providers for ado.net framework?
What is the c# equivalent of c++ catch (…), which was a catch-all statement for any possible exception? Does c# support try-catch-finally blocks?
Do we get an error while executing the “finally” block in c#?
what is generics? can u explain 5 to 6 examples on generics that covers class,method,structure,list,delegates?
How do I know if executenonquery is successful c#?
Explain About remoting and web services. Difference between them
What is the main usage of keyword “virtual†? How does it work for a method or property?