0
3.8kviews
| written 8.0 years ago by |
Let's see the example of how to convert binary to hexadecimal in java.
import java.util.Scanner;
class BinaryToHexadecimal
{
int number;
Scanner s;
void takeBinaryValue()
{
s = new Scanner(System.in);
System.out.println("Enter the binary value");
number = Integer.parseInt(s.nextLine(), 2);
}
void conversion()
{
String hexa = Integer.toHexString(number);
System.out.println("hexadecimal value is: "+hexa); …