Why does this part of code fail:
Integer.parseInt(\"11000000000000000000000000000000\",2);
Exception in thread \"main\" java.lang.NumberFormatException: For
This is because for Integer.parseInt "11000000000000000000000000000000" is not a two's complement representation of -1073741824 but a positive value 3221225472 which does not fit into int values range -2147483648 to 2147483647. But we can parse two's complement binary string representation with BigInteger:
int i = new BigInteger("11000000000000000000000000000000", 2).intValue()
this gives expected -1073741824 result