java - int with leading 0's behave strangely -


Possible duplicates:

  int num = 0200; Println (number); // 128 System.out.println (033); // 27    

Sure - this should be used as octal According to java language specificity, verbally,:

One digit number has an ASCII score of 0, followed by one or more ASCII digits 0 to 7 and one positive , Zero, or negative integer Octel diabetes: octal diabetes octal diabetes: octal digest octaligit octal diabetes octal digit: 1 2 3 4 5 6 7

Note that octal The score always consists of two or more digits; 0 is always considered a decimal number, not that it is very important in practice, because for all the 0, 00 and 0x0 digits, all represent the same integer value.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

memcached - Django cache performance -

java : convert string value to int -