2014-02-20 60 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;