|
What I wanted was this "A \n", and instead, what I got was a COMPILE ERROR
String literal is not properly closed by a double-quote
What the hell! I have represented characters as unicode earlier in my Java code. So what was wrong here. It seems the compiler did not like the unicode newline character I had added. Here's why...
The compiler translates unicode characters at the beginning of the compile cycle. Which means the above source first gets converted to
|
You might also enjoy reading this issue of the Java Specialists newsletter.
If you trying to represent newline or carraige return characters as unicode in your Strings, don't bother. It will not work. Use "\n" and "\r" instead.
3 comments:
thanks for the post -- it resolved my problem
This is exactly what I was looking for! Thanks!!
Just ran into this issue myself. This is so frigging ridiculous.
Post a Comment