static char doesnt display in System.out.println()
Praveen Babu
Ranch Hand
Joined: Jul 30, 2006
Posts: 138
posted
0
Hi All,
doesnt give any thing and blocks all next statements from displaying
while,
returns 0 // this is ok Why is this so ?
Bye & Regards, Praveen
[ August 02, 2006: Message edited by: praveen babu ] [ August 02, 2006: Message edited by: praveen babu ]
wise owen
Ranch Hand
Joined: Feb 02, 2006
Posts: 2023
posted
0
you did not init. c variable and the default value is '\u0000' (invisible).
Praveen Babu
Ranch Hand
Joined: Jul 30, 2006
Posts: 138
posted
0
Hi,
If default value is invisible then how come it took part in the arithmetic calculation in the next code and why is it blocking code below it to display. Please can you clarify ?
Binary numeric promotion is performed on the operands (�5.6.2). The type of an additive expression on numeric operands is the promoted type of its operands. If this promoted type is int or long, then integer arithmetic is performed; if this promoted type is float or double, then floating-point arithmetic is performed.
"a + c" will be an int '0'. [ August 02, 2006: Message edited by: wise owen ]
Praveen Babu
Ranch Hand
Joined: Jul 30, 2006
Posts: 138
posted
0
Hi,
Thanks Wise for your reply,
-Now i know why the final output is 0. -Is the compiler unable to display the '\u0000' (invisible) char ? Is this the reason why it doesnt print lines after it for example,