Post

@EclipseJavaIDE ABC. Little known fact: int literals with leading zeros are interpreted as octals.
English

@EclipseJavaIDE 020 (octal) = 16 and no break in case statements > output is 'ABC'
English

@EclipseJavaIDE @java And another example of bad language design. @kotlin has fixed this with the when statement superkotlin.com/kotlin-when-st…
English

@EclipseJavaIDE I think that 0 starting number literal is not good idea in the first place.
English

@EclipseJavaIDE The result is AB because 020 is the octal representation of decimal number 16.
English

@EclipseJavaIDE output is ABC since 16 will match its octal representation 020, and no 'break' statements so the other two cases are executed as well
English






















