Is there any function equivalent to bin2hex () of php for Java? I need to convert a binary to hexadecimal.
Is there any function equivalent to bin2hex () of php for Java? I need to convert a binary to hexadecimal.
You can do so
String hexa = Integer.toString(Integer.parseInt("1111", 2), 16);
And from hexadecimal to binary too
String bin = Integer.toString(Integer.parseInt("ff", 16), 2);