File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Modifiers for Main method

 
Akhilesh Trivedi
Ranch Hand
Posts: 1599
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I heard 'final" can be prefixed to a main method. Can somebody tell me, what are the modifiers that can be added to LEGAL main method?

I searched for same in older threads, and was wondering why the following one was shifted else where???


http://www.coderanch.com/t/190344/java-programmer-SCJP/certification/Main-Method


:roll:
 
Mahendar Reddy
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As i know...
We should have "public static void" b4 main(String[] a)
We can also have "final/synchronized/strictfp" b4 'main'.but nothing else..

 
Barry Gaunt
Ranch Hand
Posts: 7729
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java Virtual Machine Specification says that main must be "public static void" For the SCJP examination that's all you need to know.
 
Akhilesh Trivedi
Ranch Hand
Posts: 1599
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do I always forget JLS-the best place to refer??? :roll:

Thanks barry.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic