Question 1 A>
In
Java,
case can accept
int、char primitive typ,
if I use
byte、short primitive type as expression, only because of Java
will auto convert
byte、short to
int, so Java can compile and run?
But why
case can't accept long type?? What does this design purpose for?
B>
Is there any
simple way to instead of
like this or somethig:
Question 2 I use
return instead of
break in codes, and Java still compile&run OK.
Is there something difference between
return and
break when
I write codes in switch-case? I mean that can cause different results if I use
return instead of
break??
Question 3 If I rewrite codes like this:
Java compile error:
empty character literal
unclosed character literal
What does it mean?
case '' means case null ??? Is it right ??
If someone can help me, I would be very appreciated!!
[ March 10, 2004: Message edited by: Ha LoHa ]
[ March 10, 2004: Message edited by: Ha LoHa ]