File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Signature of main() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Signature of main() method" Watch "Signature of main() method" New topic
Author

Signature of main() method

Thomas Markl
Ranch Hand

Joined: Mar 08, 2001
Posts: 192
class Test20 {
final static void public main(String args[] {} // ERROR!
// final static public void main(String args[]){ } // OK
}
Why this error?
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Because before the method name there must stand the return type which is in this case void.
Peter Kristensson
Ranch Hand

Joined: Jul 02, 2001
Posts: 118
final static void public main(String args[] {} // ERROR
you forgot the closing right parenthesis.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Signature of main() method
 
Similar Threads
valid combinations of Modifiers like static,native,transient etc
Non-overridable methods
Global final v/s Local final
main method
main()