|
Java™ by example!
|
|
|
How do I convert a hexadecimal (hex), octal, or binary value to an integer?
Use the static method parseInt in the Integer primitive wrapper class. You pass in a string containing the digits of the specified radix. If a digit is not in the radix range, you'll get a NumberFormatException.
Here's an example:
Further Information
Author of answer: Joris Van den Bogaert
Comments
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|