+ 2

What does int a=Integer.parseInt(a,2);do when String a="1010";

From challenge

12th Sep 2017, 12:55 PM
Shivesh Gupta
Shivesh Gupta - avatar
1 Odpowiedź
+ 7
Integer.parseInt(String) Will cast the argument to a int. Integer.parseInt(String, int) The String is what will be casted, the int is what base the String is in. So, in this example the string will be casted to a number (10) from base 2.
12th Sep 2017, 2:34 PM
Rrestoring faith
Rrestoring faith - avatar