We would like to know how to parse and Format Binary Number to Decimal, back and forth.
/*from ww w .j a va 2 s. c om*/ public class Main { public static void main(String[] argv) throws Exception { int i = 1023; i = Integer.parseInt("1111111111", 2); String s = Integer.toString(i, 2); System.out.println(s); } }
The code above generates the following result.