aspose 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
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.
 
jQuery in Action, 2nd edition
 
subject: Signature of main() method