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 / sasi
static void Main(string[] args)
{
int i = 1, j = 1;
Console.WriteLine(i + j);
Console.WriteLine("\n" + i.ToString() + j.ToString());
Console.WriteLine("\n"+((object)i==(object)j));
Console.ReadLine();
}
output:-
2
11
false
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
Why delegates are type safe in c#?
What are namespaces, and how they are used?
What can we do to handle multiple exceptions?
How does return work in c#?
What is string [] args in c#?
What is getenumerator?
Explain how do you convert a value-type to a reference-type?
What is difference between dictionary and hashtable in c#?
What are the concepts of dispose method?
What is Wrapper class in dot net?
Explain acid rule of thumb for transactions in c#.
Is array ienumerable c#?
Is it possible to inherit multiple interfaces?
How can I make sure my c# classes will interoperate with other .net languages?
What is ac callback?