| Response(s) |
Posted by: Nirajagrawal | Posted on: 08 Mar 2009 11:16:42 PM
Brother,
First of all, I thank you for taking efforts in posting this question. I tried implementing this in one of the Console Applications and the output of:
Class A { static byte a; static short b; static char c; static int d; static long e; static string s; Public Static Void Main(String args[]) { Console.WriteLine(a+b+c+d+e+s); } }
is '0 ' and not '0null ' ... Please check it at your end and if possible modify your option ... it will help us guide people in the correct way.
According to me, the correct answer for this question is Option 4 and not Option 3.
No hard feelings ... we all are here to help each other !!!
Regards,
Niraj Agrawal
|
Posted by: Im4uonli | Posted on: 16 Mar 2009 05:22:13 AM
Niraj is right and I wonder that still the Person posted the Question has not changed the Answer to the Correct one i.e option D.
I think Bro You have guessed the answer logically and have not implemented it.
|
Posted by: Dmitriaa | Posted on: 12 May 2009 02:01:52 PM
The specification says the following.
"The binary + operator performs string concatenation when one or both operands are of type string. If an operand of string concatenation is null, an empty string is substituted. "
That explains why the correct answer is 0 (option 4).
|