You need to specify the radix. There’s an overload of Integer#parseInt()
which allows you to.
int foo = Integer.parseInt("1001", 2);
You need to specify the radix. There’s an overload of Integer#parseInt()
which allows you to.
int foo = Integer.parseInt("1001", 2);