Need to use public,static keywords in main function?

Answer Posted / suresh

Main method is called by jvm...
jvm is out side the class
so main method must be pulic
then only jvm can access.

No instance of the class is needed to
execute the static method.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create a thread in java?

841


What is use of valueof () in java?

781


What is meant by tab pans?

846


What is a singleton in genetics?

786


Why method overriding is used?

763


what do you understand by the term string with respect to java?

765


What are the advantages of autoboxing?

743


What is variable explain with example?

779


What do you mean by synchronized non access modifier?

748


How do you identify if jvm is 32-bit or 64-bit from java program?

723


What is the difference between a switch statement and an if statement?

746


What is internal variable?

730


What restrictions are placed on method overloading?

864


Mention the default values of all the elements of an array defined as an instance variable.

725


What is a dynamic array java?

712