Synopsis: | Do not start a literal by 0 unless it's an octal value |
Language: | Java |
Severity Level: | 2 |
Category: | Basic |
Description: |
Integer literals should not start with zero.
Zero means that the rest of literal will be interpreted as an octal value.public class Foo { int i = 012; // set i with 10 not 12 int j = 010; // set j with 8 not 10 k = i * j; // set k with 80 not 120 } |