The following code will compile with javac and run:
public class Foo {
char c1 = '''; # Works, although it should not.
char c2 = '\'';
public static void main(String args[]) {
Foo f = new Foo();
System.out.println("The first char is (" + f.c1 +
") and the second is (" + f.c2 + ").");
}
}
Obviously, it's a coding mistake for the developer to do this at all.
But this version of the the javac parser does not catch it.
###@###.### 10/19/04 19:24 GMT
public class Foo {
char c1 = '''; # Works, although it should not.
char c2 = '\'';
public static void main(String args[]) {
Foo f = new Foo();
System.out.println("The first char is (" + f.c1 +
") and the second is (" + f.c2 + ").");
}
}
Obviously, it's a coding mistake for the developer to do this at all.
But this version of the the javac parser does not catch it.
###@###.### 10/19/04 19:24 GMT