Error in Eclipse - Mainclass not found

后端 未结 5 1897
醉酒成梦
醉酒成梦 2021-01-24 10:01

I\'m new in programing and I like it pretty much. I\'ve just downloaded Eclipse and I got an error I can\'t help me with. Unfortunately it\'s in German but the meaning is someth

5条回答
  •  隐瞒了意图╮
    2021-01-24 10:47

    When developing a core-java application, all you need to do is to have a main method (ofcourse with the functionality :P) in it which is the first code fragment JVM Searches for when you try to run your application. For the above code, try this:

    public static void main (String [] args) {
    
    //Now, make an instance of your class to instantiate it.
    
    Elevator obj = new Elevator();
    
    //Then,as per the desired functionality. Call the methods in your class using the reference.
    
    //obj.move(val of stage);
    
    obj.move(10);
    }
    

    Just make sure to have a main method for executing your java code. Happy Coding :)

提交回复
热议问题