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

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

python - malformed header from script index.py Bad header -