0
3.8kviews
How To Convert Binary to Hexadecimal in Java
1 Answer
0
51views

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); …

Create a free account to keep reading this post.

and 2 others joined a min ago.

Please log in to add an answer.