A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
Signature of main() method
Thomas Markl
Ranch Hand
Joined: Mar 08, 2001
Posts: 192
posted
Aug 13, 2002 01:06:00
0
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
posted
Aug 13, 2002 01:23:00
0
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
posted
Aug 13, 2002 01:24:00
0
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()
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter