End Google Ads 201810 - BS.net 01 -->
Convert Hexadecimal into Binary and Long in java - source code
كود:
import java.io.*;
import java.lang.*;
/**
*
* @author A7med Baraka
* www.barakasoft.com
*/
public class HexadecimalToBinaryAndLong{
public static void main(String[] args) throws IOException{
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the hexa value!");
String hex = bf.readLine();
int i = Integer.parseInt(hex);
String by = Integer.toBinaryString(i);
System.out.println("This is Binary: " + by);
long num = Long.parseLong(hex,16);
System.out.println("This is long:=" + num);
}
}
مواقع النشر (المفضلة)