Back
Below is my code implementation:
String c = "110010";
How to convert the binary string to a value in decimal in Java?
You can use Integer.parseInt to convert binary string to int with base two. See the code below:
int decimalValue = Integer.parseInt(c, 2);
Interested in Java? Check out this Java tutorial by Intellipaat.
31k questions
32.8k answers
501 comments
693 users