string parseBinaryAndDecimal(string binary) code example Example: binary string to int java int decimal=Integer.parseInt(binaryString,2);