Hi ,
I am a new member fo this group and preparing for
SCJP 1.4
I have a question regarding Casting when we have a loss of precision when typecasted to low .
Say for eg:
byte b=(byte)128;
It wil give the output as -128 .
Again
byte b=(byte)129;
it will give the output as -127.
I have seen in the K&B book , they have explained it very well.
But it seems to be time consuming process....
(Taking two's compliment then change the value etc .... )
Are these type of question are asked in the exams .???
If yes , then do we have any short cut to crack the question...
Thanks in advance !!!
Cheers
Yogesh
(No need to shout in topic titles)
[ August 31, 2005: Message edited by: Barry Gaunt ]