JLS 15.18
The type of each of the operands of the + operator must be a primitive numeric type, or a compile-time error occurs.
In every case, the type of each of the operands of the binary - operator must be a primitive numeric type, or a compile-time error occurs.
Originally posted by Ashish Hareet:
[B]With an explicit cast you are pretty much correct Angela .
Here's an interesting piece I came across while working around with this sorta stuff . Might aswell share it with you lot .
[/B]
Ashish[/B]
Regards<BR>Gurpreet Sachdeva<P>For Mock Exams, FAQ, Exam tips and some useful information about Bitshift operator, inner classes, garbage collection,etc please visit: <A HREF="http://www.go4java.lookscool.com" TARGET=_blank rel="nofollow">http://www.go4java.lookscool.com</A>
Originally posted by Ashish Hareet:
Integer.MAX_VALUE + int( so also byte & short) makes the result go back to the negative end of the number line.
That answers both of your queries Sandeep .
Did we forget a "L" somewhere ?
Ashish
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |