This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread 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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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: 20174
    
  47

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [solved]when i run file,promt message "Class "lab4.que1" does not have a main method."why?
 
It's not a secret anymore!