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 dependency injection is used in c#?
What is deadly diamond problem?
What is data type in c# with example?
Explain about Error handling and how this is done
What is a thread c#?
What is the difference between finalize() and dispose()?
What is the size of a decimal?
Why do we use classes?
What is an escape sequence? Name some string escape sequences in c#.
What is asynchronous one-way calls?
What is Co- and Contra-Variance in C#?
What is static classes in c#?
How garbage collection deals with circular references.
What are verbatim strings in c#?
What is different between Boxing and Unboxing?