简体   繁体   English

“未声明”错误是什么意思?

[英]What does the “not an statement” error mean?

I am new to java programming. 我是Java编程的新手。 I tried hello world program, but I got an error " not a statement ". 我尝试了hello world程序,但出现错误“ not statement ”。 Whereas when I copy, paste the hello world program from the internet, my program compiled. 而当我复制时,从Internet粘贴hello world程序,则我的程序已编译。 This is the program I used. 这是我使用的程序。 What is meant by " not a statement ", please explain why I got this error and what is meant by it and what should I look for when I get this error in the future. 不是声明 ”的含义是什么,请解释为什么会出现此错误,它的含义是什么,以及将来出现此错误时应该寻找什么。 Thanks! 谢谢!

public class hello
{
    public static void main(String args[]) {    
        System.out.println(“hello world”);
    }
}

My errors:- 我的错误:

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

You code cannot contain smart quotes like your used in your "Hello World". 您的代码不能包含智能引号,例如您在“ Hello World”中使用的引号。 I replaced your smart/fancy quotes with the correct kind. 我用正确的类型替换了您的灵巧/奇特的报价。

public class hello
{
    public static void main(String args[]) {    
        System.out.println("hello world");
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM