In this section, you will learn to convert the hexadecimal data into the binary and long format. The java.lang package provides the functionality to convert a hexadecimal to binary and long type data.
This program helps you in converting the hexadecimal data into the binary and long. At run time this program asks for a a hexadecimal data and it then converts it into an integer type data. The toBinaryString() method converts an integer data into binary data. And the parseLong() method converts the hexadecimal data into a long type data.
Here is the code of this program:
Output of this program.
Enter the hexa value!
This is Binary: 1110
This is long:=20
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: June 15, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles