Java tutorial
public class Main { public static void main(String[] args) { String str = "01111111"; int radix = 2; // Creates an Integer object from the string Integer intObject = Integer.valueOf(str, radix); // Extracts the int value from the string int intValue = Integer.parseInt(str, 2); System.out.println("str = " + str); System.out.println("intObject = " + intObject); System.out.println("intValue = " + intValue); } }