How to convert binary string value to decimal

Use Integer.parseInt (see javadoc), that converts your String to int using base two:

int decimalValue = Integer.parseInt(c, 2);

Leave a Comment