Check out example codes for "binary to integer in java". It will help you in understanding the concepts better.

Code Example 1

System.out.println(Integer.parseInt("1010",2));

Code Example 2

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

Code Example 3

int decimal=Integer.parseInt(binaryString,2);

Learn ReactJs, React Native from akashmittal.com