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

What are the concepts of 'OOPS'?

691


What is the difference between interface & abstract class?

663


Why local variables are stored in stack?

588


What are the different types of java?

647


What does next mean in java?

630






What is runtime locatable code?

980


How to make a write-only class in java?

683


What are features of java?

663


why we use merge option in hybernate pls give a ex snippet

1556


What is difference between equal and == in java?

601


Can we make constructors static?

831


What is ‘is-a ‘ relationship in java?

678


What is an arraylist in java?

604


In multi-threading how can we ensure that a resource isn't used by multiple threads simultaneously?

954


What are access specifiers available in java?

667