How to Convert from binary to hex in java
Simple One line code to convert String containing a binary value to Hex String bin = Integer . toHexString ( Integer . parseInt ( binOutput , 2 )); Full Code for conversion import java.io.* ; import java.lang.* ; public class BinaryToHexadecimal { public static void main ( String [] args ) throws IOException { BufferedReader bf = new BufferedReader ( new InputStreamReader ( System . in )); System . out . println ( "Enter the Binary number:" ); String hex = bf . readLine (); long num = Long . parseLong ( hex ); long rem ; while ( num > 0 ){ rem = num % 10 ; num = num / 10 ; if ( rem != 0 && rem != 1 ){ System . out . println ( "This is not a binary number." ); System . out . println ( "Please try once again." ); System . exit ( 0 ); } } int i = Integer . parseInt ( hex , 2 ); String hexString = Integer . toHexString ( i ); System . out . println ( "Hexa decima...