I have a Project in Bus Ticker Reservation. and I have also Source code but when run into eclipse got an error "Selection does not contain a main file" please help me I am new in Programming
screenshot attached
I have a Project in Bus Ticker Reservation. and I have also Source code but when run into eclipse got an error "Selection does not contain a main file" please help me I am new in Programming
screenshot attached
The class to be executed needs a method with the following signature: public static void main(String[] args)
.
You need to create a main method. When you execute a class, the runtime system starts by calling the class's main() method, so without it your class will not get executed.
So you need to add the following code to the class you are trying to run:
public static void main(String[] args){
ClassName c = new ClassName();
}