Why do some character literals cause Syntax Errors in Java?
问题 In the latest edition of JavaSpecialists newsletter, the author mentions a piece of code that is un-compilable in Java public class A1 { Character aChar = '\u000d'; } Try compile it, and you will get an error, such as: A1.java:2: illegal line end in character literal Character aChar = '\u000d'; ^ Why an equivalent piece of c# code does not show such a problem? public class CharacterFixture { char aChar = '\u000d'; } Am I missing anything? EDIT: My original intention of question was how c#