In this section, you will learn how to convert a binary number into a decimal number. The java.lang package provides the facility to convert the integer data into the binary to decimal.
In this program, you will learn the use of parseLong() method. Define a class "BinaryToDecimal" using the parseLong() method. This method is used to parse the string argument as a signed decimal long. This method has been used for converting a long to a string and a String to a long.
Here is the code of this program:
Output of this program:
Enter the Binary value:
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.