Why is '\117' a valid character literal in Java?

character, java, special-characters

Solution

This is the octal representation for ascii. You can see lots more values of it here: http://donsnotes.com/tech/charsets/ascii.html

Problem

I've seen this `char` defined as `char ch = '\117'` What kind of representation is `'\117'` in? I know `escaped-sequence` is `'\n'`, for instance, or `unicode` is ``\udddd'`, where `d` is a single hex digit, but I've never seen such thing as `'\117'` in my entire life! Surprisingly, it does compile! (And the output is `O`)

Original source

Related problems