|
Java™ by example!
|
|
|
How do I convert an integer to a hexadecimal (hex), octal or binary representation?
Three useful functions in the Integer class do exactly this. Following program demonstrates the use. Notice that the method toHexString returns the hexadecimal representation in lowercase!
outputs:
Further Information
Author of answer: Joris Van den Bogaert
Comments
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|