Funny, because you used exactly the digits making it work (in some cases, you will get a compilation error!).
Java inherited from the C language a bizarre syntax: we can specify number in octal notation. It is nearly never used (GoToLoop found out an original usage with color shifting), but it is here.
If you prefix an integer number (with digits between 0 and 7) with a zero, you automatically trigger this octal notation.
So 031 is actually 25.
println(031 == 25); // Shows true
Making the old joke that Halloween is the same than Christmas:
Oct 31 == Dec 25
(octal vs. decimal)
Java inherited from the C language a bizarre syntax: we can specify number in octal notation. It is nearly never used (GoToLoop found out an original usage with color shifting), but it is here.
If you prefix an integer number (with digits between 0 and 7) with a zero, you automatically trigger this octal notation.
So 031 is actually 25.
println(031 == 25); // Shows true
Making the old joke that Halloween is the same than Christmas:
Oct 31 == Dec 25
(octal vs. decimal)