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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -