Java compilation in terminal gives invalid character errors within string
I'm a beginner and just trying to make the most basic of them all, simple "Hello World"
Here is the code.You will find the same thing anywhere:
class HelloWorld {
public static void main (String args[]) {
System.out.println("Hello World!");
}
}
When I launch Terminal (I am using Mac), I get asked with the following errors:
HelloWorld.java:3: error: illegal character: '\u201c'
System.out.println("Hello World!");
^
HelloWorld.java:3: error: ';' expected
System.out.println("Hello World!");
^
HelloWorld.java:3: error: not a statement
System.out.println("Hello World!");
^
HelloWorld.java:3: error: ';' expected
System.out.println("Hello World!");
^
HelloWorld.java:3: error: illegal character: '\u201d'
System.out.println("Hello World!");
^
5 errors
What's going on here? All errors are string!
+3
source to share
3 answers