code as following
...
String s1=Integer.toBi naryString(-1073741824)
System.out.prin tln(s1);
int i2=Integer.pars eInt(s1,2);
...
the output is ...
110000000000000 000000000000000 00
java.lang.Numbe rFormatExceptio n: For input string: "11000000000000 000000000000000 000"
at java.lang.Numbe rFormatExceptio n.forInputStrin g(NumberFormatE xception.java:4 8)
at java.lang.Integ er.parseInt(Int eger.java:480)
at com.main.Tester .main(Tester.ja va:18)
what's the matter? how to resolve it?
...
String s1=Integer.toBi naryString(-1073741824)
System.out.prin tln(s1);
int i2=Integer.pars eInt(s1,2);
...
the output is ...
110000000000000 000000000000000 00
java.lang.Numbe rFormatExceptio n: For input string: "11000000000000 000000000000000 000"
at java.lang.Numbe rFormatExceptio n.forInputStrin g(NumberFormatE xception.java:4 8)
at java.lang.Integ er.parseInt(Int eger.java:480)
at com.main.Tester .main(Tester.ja va:18)
what's the matter? how to resolve it?
Comment