介于0到255之间的字符值可以用从"\000""\377"的八进制文字表示。

那么"\400"不应该是编译时错误吗? Eclipse没有抱怨,但是...这是怎么回事?

最佳答案

解释为“\ 40” +“0”

Java语言规范描述了此here

OctalEscape:
    \ OctalDigit
    \ OctalDigit OctalDigit
    \ ZeroToThree OctalDigit OctalDigit

OctalDigit: one of
    0 1 2 3 4 5 6 7

ZeroToThree: one of
    0 1 2 3

08-26 11:58