1
由於某些原因,我添加並從代碼中移除了一個靜態可用的項目後,eclipse開始給我調用所有函數的錯誤,並說這些函數必須是靜態的。但是,如果我讓程序運行這些錯誤,程序就像我打算的那樣運行。我的代碼:Eclipse強制所有東西都是靜態的
package main;
public class Main implements Runnable {
public void start() {
Thread thread = new Thread(this);
thread.start();
System.out.println("Running...");
Ball.test(); <--- Giving me an error
}
public void run() {
}
public void stop() {
System.out.println("Exiting...");
}
}
,當我創造球名爲test的方法它給了我:
public static void test() {
// TODO Auto-generated method stub
}
我是個白癡,我怎麼會忘記它!非常感謝 –