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 meant by pass by reference and pass by value in java?
Is it better to learn java or python?
What is xml file in java?
What is meant by framework in java?
What is java ioc?
What is numberformatexception in java?
Describe life cycle of thread?
Why we use beans in java?
Does ms edge support java?
Which is best framework in java?
How do you find lambda?
What are the advantages of java 8’s date and time api over old date api and joda time api?
Please can anybody explain what exactly "the project architecture" means???
Explain daemon thread.
What is cloning in java?