binary to int java

Java
int foo = Integer.parseInt("1001", 2); // 2 is the radix
Source

Also in Java: