[英]What does the “not an statement” error mean?
我是Java编程的新手。 我尝试了hello world程序,但出现错误“ not statement ”。 而当我复制时,从Internet粘贴hello world程序,则我的程序已编译。 这是我使用的程序。 “ 不是声明 ”的含义是什么,请解释为什么会出现此错误,它的含义是什么,以及将来出现此错误时应该寻找什么。 谢谢!
public class hello
{
public static void main(String args[]) {
System.out.println(“hello world”);
}
}
我的错误:
hello.java:8: error: illegal character: '\u201c'
System.out.println(“hello world”);
^
hello.java:8: error: ';' expected
System.out.println(“hello world”);
^
hello.java:8: error: illegal character: '\u201d'
System.out.println(“hello world”);
^
hello.java:8: error: not a statement
System.out.println(“hello world”);
^
4 errors
您的代码不能包含智能引号,例如您在“ Hello World”中使用的引号。 我用正确的类型替换了您的灵巧/奇特的报价。
public class hello
{
public static void main(String args[]) {
System.out.println("hello world");
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.