aspose file tools
The moose likes Beginning Java and the fly likes Signature of main() method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply 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://zeroturnaround.com/jrebel/download
 
subject: Signature of main() method
 
Similar Threads
valid combinations of Modifiers like static,native,transient etc
main method
Global final v/s Local final
Non-overridable methods
main()