java - Scanner.nextBigInteger(int radix) -
why code:
public static void main(string[] args) { string s = "23 hello world! 3 + 3.0 = 6 "; // create new scanner specified string object scanner scanner = new scanner(s); // scan next token big integer radix 4 system.out.println("" + scanner.nextbiginteger(4)); // close scanner scanner.close(); }
output 11?
it reads first token in string 23
number in base 4. value 2 * 4 + 3 = 11 printed result.
Comments
Post a Comment