This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes [solved]when i run file,promt message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "[solved]when i run file,promt message "Class "lab4.que1" does not have a main method."why?" Watch "[solved]when i run file,promt message "Class "lab4.que1" does not have a main method."why?" New topic
Author

[solved]when i run file,promt message "Class "lab4.que1" does not have a main method."why?

L Willie
Ranch Hand

Joined: Aug 10, 2008
Posts: 51


above is my complete program file,what wrong to the code?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18757
    
  40

main method needs to be static for the class to be executed from the command line.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
L Willie
Ranch Hand

Joined: Aug 10, 2008
Posts: 51
Henry Wong wrote:main method needs to be static for the class to be executed from the command line.

Henry

thank
 
 
subject: [solved]when i run file,promt message "Class "lab4.que1" does not have a main method."why?