| Author |
Integer to Byte
|
Balaji Bang
Ranch Hand
Joined: Apr 23, 2007
Posts: 180
|
|
hi how the convertion from integer to byte happens? byte y=(byte)230; y value is -26.how the result will be -26 anyone please help me.....
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9189
|
|
|
Well Banu the value 230 is out of the range of byte which is from -128 to 127. So the value 230 will be truncated. This truncation happens at the binary level. Just read a tutorial about Number Systems to understand this concept...
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
 |
|
|
subject: Integer to Byte
|
|
|