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
How do I run a java project in netbeans?
What is stateless in java?
When is static variable loaded? Is it at compile time or runtime? When exactly a static block is loaded in java?
What is flatmap in java8?
What happens when you omit a brace or misspell one of the words, like public or
Explain the reason for each keyword of public static void main(string args[])?
What is singleton pattern in java?
What is meant by java se?
Which type of stream is in java?
Who is at risk in java? : java security
How do you run an executable jar file?
What is ui framework in java?
ioc vs dependency injection?
Which version of my browser should I use? : java security
What are jdk tools?