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 differences between getting and load method?

538


What happens if an exception is throws from an object's destructor?

579


Is java type safe?

503


Write a program to find maximum and minimum number in array?

546


What are wrapper classes in java?

592






Can anonymous class have constructor?

548


What is the main functionality of the remote reference layer?

1409


difference between byte stream class and character stream class?

4079


What is procedure writing?

507


Does java linked list allow duplicates?

550


What is number data type?

530


What is are packages?

581


What is hash code collision?

585


What is foreach loop in java?

528


How does linkedlist work in java?

503