Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

main() method signature

 
Rahul Gupta
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I had seen in many sites and certification books that the access specifier public in the main methods signature
public final static void main(String args[])
{ /*...*/}
is mandatory.
However I find that even with other access specifier with main (other than public like protected, private etc.) the code compiles and runs fine.
Please specify what exactly is mandatory and what is not. I am confused.
Thanks,
Rahul
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You asked this question twice, less than an hour apart. It has been answered already here
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic