【发布时间】:2014-02-25 03:09:32
【问题描述】:
我是编程新手,我非常喜欢它。我刚刚下载了 Eclipse,但遇到了一个无法帮助我解决的错误。不幸的是,它是德语,但含义类似于:“未找到主要课程”-“Fehler: Hauptklasse konnte nicht gefunden oder geladen werden”
我知道它与“public static void main(String [] args)”有关。
由于这对我来说是全新的,所以你能帮助我会很酷。
下面的错误源代码;
/**
* Write a description of class Light here.
*
* @author (Sunny)
* @version (31.01.2014)
*/
public class Elevator {
// Variables
int maxCarr; // max. carry in KG
int currentCarr; // current state of carry measured in people
boolean fillCondition; // filed or empty - value false = empty
int currentStage; // stage where elevator remains
// Constructor
public Elevator() // initiation
{
maxCarr = 1600;
currentCarr = 0;
fillCondition = false;
currentStage = 0;
System.out.println("**********");
System.out.println("* *");
System.out.println("* *");
System.out.println("* *");
System.out.println("* *");
System.out.println("* *");
System.out.println("* *");
System.out.println("**********");
}
public int (int carry) // Setting carry into the elevator
{
currentCarr = carry;
if (currentCarr != 0) {
fillCondition = true;
return 1;
} else {
return 0;
}
}
public void move(int stage) {
if (stage > currentStage) {
System.out.println("moving up");
currentStage = stage;
} else {
System.out.println("moving down");
currentStage = stage;
}
}
}
【问题讨论】:
-
只需将
public static void main(String[] args){Elevator();}添加到您的代码中