Check out example codes for "binary string to int java". It will help you in understanding the concepts better.
Code Example 1
int decimal=Integer.parseInt(binaryString,2);
Code Example 2
int foo = Integer.parseInt("1001", 2); // 2 is the radix
Learn ReactJs, React Native from akashmittal.com