binary as int java code example
Example 1: binary numbers java
int binaryNumber = 0b1001;
//binaryNumber == 9
Example 2: binary to int java
int foo = Integer.parseInt("1001", 2); // 2 is the radix
int binaryNumber = 0b1001;
//binaryNumber == 9
int foo = Integer.parseInt("1001", 2); // 2 is the radix