Meaningless Drivel is fun!
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Errata in JLS ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Errata in JLS ???" Watch "Errata in JLS ???" New topic

Errata in JLS ???

Vijay Albuquerque
Ranch Hand

Joined: Feb 17, 2002
Posts: 42
I found the following quote in the JLS document for String literals:
It is a compile-time error for a line terminator to appear after the opening " and before the closing matching ".

I compiled the following code on JDK 1.4.1

The above code compiled and ran fine.
Is the above quote an errata in the JLS or am I missing something?
Thanks in advance !!!
[ November 03, 2002: Message edited by: Vijay Albuquerque ]

Vijay Albuquerque
SCJP 1.4, SCWCD 1.3
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
A "line terminator" isn't a semicolon. A line terminator
is the end of a line -- a newline or carriage return.
This is what the JLS prohibits:

The compiler complains: unclosed string literal
String test = "This is
^ unclosed string literal
a test";
^ ';' expected
a test";
3 errors

Ron Newman - SCJP 1.2 (100%, 7 August 2002)
I agree. Here's the link:
subject: Errata in JLS ???
jQuery in Action, 3rd edition