ted_driver
asked on
How to print a Hex Value
This site's search engine doesn't seem to be working right now......this question may have been asked before.
I want to calculate a number, an int and display it as a hexadecimal value to the screen. How is this done?
Example:
int test = 0XFF;
System.out.println(test); // prints 255, I want to print FF
I would also like to be able to print the binary equivalent, can this be done also?
I want to calculate a number, an int and display it as a hexadecimal value to the screen. How is this done?
Example:
int test = 0XFF;
System.out.println(test); // prints 255, I want to print FF
I would also like to be able to print the binary equivalent, can this be done also?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Works Great! Just what I was looking for...
Thanks!
Thanks!
Integer.toHexString(int i)
which returns a String.
Cheers Tom