Why main method should be declared as public and why in some versions it is mandatory and in some versions it is not mandatory??

Showing Answers 1 - 2 of 2 Answers

raghavendra

  • Oct 21st, 2005
 

Because it is accessed from outside and it is user oriented

  Was this answer useful?  Yes

Giridhar Reddy

  • Apr 11th, 2006
 

public static void main(String args[])

Here we helping the jvm to call main method without any object

that is why main is declared as public static.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions