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 @resource annotation in java?
What is csrf in java?
can a program use more than one command-line argument?
What is jar file in java?
What is setstring method in java?
What happens when the parent process of a child process exits before the child ?
What is the difference between a jvm and a jdk?
Explain daemon thread.
What is stateful in java?
How does java handle integer overflows and underflows?
What is a static method?
What is cookie in java?
Where is singleton design pattern used in java?
What is interceptor in java?
What is the difference between java se and java ee?