We can convert binary to decimal in java using Integer.parseInt() method or custom logic.
Java Binary to Decimal conversion: Integer.parseInt()
The Integer.parseInt() method converts string to int with given redix. The signature of parseInt() method is given below:
public static int parseInt(String s,int redix)
Output:
Let's see another example of Integer.parseInt() method.
Output:
Java Binary to Decimal conversion: Custom Logic
We can convert binary to decimal in java using custom logic.
Output: