What is the need to declare main() method as static in Java?
Answer Posted / monalisa
public static void main(String[] args) means
public - is the access modifier .if we declare a method as
public means we can access the method out side of the class.
static - It is a key word.If we declare a method as static
then we can call this method with out creating any instance
of that class.Directly we can call it by "CLASSNAME.STATIC
METHOD NAME"
void - It is the return type of the method
main - It is the Method name
| Is This Answer Correct ? | 10 Yes | 0 No |
Post New Answer View All Answers
What is jpa used for?
Why do we need new date and time api in java se 8?
Is java built on c?
What are the disadvantages of java sockets?
What is a java proxy?
What is the difference between a jdk and a jvm?
Why is class forname used in java?
Is eclipse a jdk?
How do you type the lambda symbol?
Which is more secure: java or activex? : java security
What is proxy object in java?
What is @resource annotation in java?
Are jvm’s platform independent?
Describe the principles of oops.
What is default constructor in java?