On Feb 19, 7:10 pm, Andreas Leitgeb <a...@gamma.logic.tuwien.ac.at>
wrote:
> >> but i can not find why i can not use
> >> // char c = '\u000a'
[quoted text clipped - 8 lines]
>
> // :-)
yes, i understand: new line begin with comment!
ok.
just to test myself:
it is not an error:
// \u000a
but error is
// \u000a something_else
where "something_else" is not spaces or something placed in correct
Java-style comment
Patricia Shanahan - 20 Feb 2007 09:39 GMT
> On Feb 19, 7:10 pm, Andreas Leitgeb <a...@gamma.logic.tuwien.ac.at>
> wrote:
[quoted text clipped - 25 lines]
> where "something_else" is not spaces or something placed in correct
> Java-style comment
It is not an error. It is two lines of code, and something_else is on
the second line, not part of the one line comment. In the following
valid program, ("Hello, world"); is neither spaces nor a Java-style comment.
public class HelloWorld{
public static void main(String[] args){
System.out.println // \u000a ("Hello, world");
}
}
Patricia
Gordon Beaton - 20 Feb 2007 09:44 GMT
> but error is
>
> // \u000a something_else
>
> where "something_else" is not spaces or something placed in correct
> Java-style comment
Not just comments and whitespace. It's valid if something_else is
anything that can appear at the start of a line, including statements
or declarations, etc, in the context of the most recent non-comment
before this line, e.g.:
public class
// \u000a Foo {
}
/gordon

Signature
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
dimakura - 21 Feb 2007 05:08 GMT
> > but error is
>
[quoted text clipped - 17 lines]
> [ don't email me support questions or followups ]
> g o r d o n + n e w s @ b a l d e r 1 3 . s e
i agree, my formulation was not too precise.
thanks.