main() method

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gaya3
    New Member
    • Aug 2007
    • 184

    #1

    main() method

    Hi,
    is main() in java is final by default?
    or else do we need to specify public static final void main(String args[])
    correct if i'm wrong.

    -Thanks & Regards,
    Hamsa
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by gaya3
    Hi,
    is main() in java is final by default?
    or else do we need to specify public static final void main(String args[])
    correct if i'm wrong.

    -Thanks & Regards,
    Hamsa
    You don't have to make it final but you can if you want. It doesn't make sense to make it final though. It's static so it won't be inherited and thus can't be overridden anyway.

    Comment

    Working...