| Author |
Literal for binary number
|
Gustavo Adolpho Bonesso
Ranch Hand
Joined: May 11, 2002
Posts: 103
|
|
Hi ! There is a literal form to represent a binary number, as we do have with hexadecimal numbers (0xA34F) ? For example, how can i initialize a byte variable with a binary number ? byte x = 0101011; Thanks !
|
Gustavo Adolpho Bonesso<br />SCJP1.4
|
 |
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
|
|
|
byte b = Byte.parseByte("0101011", 2);
|
[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
|
 |
 |
|
|
subject: Literal for binary number
|
|
|