2014-02-20 44 views
0

我是新来的NetBeans和Java。我正在尝试创建一个简单的脚本来重复“System.out.println()”函数中的任何内容,但我仍然遇到单个错误。 这里是我的代码:找不到或加载主类s1p1.S1P1

//create a class named S1P1 
public class S1P1 { 
    //this is the main method 
    public static void main(String[] args) { 
     //this prints out whatever is below. 
     System.out.println("Hello world!"); 
    } 
} 

我完全不知道是什么问题,但我不断收到错误,“错误:无法找到或加载主类s1p1.S1P1”。

enter image description here

+0

摆脱了将数字放在课程名称中的习惯。 –

回答

0

的Java需要一个包声明查找文件夹s1p1在类。添加

package s1p1;