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 the front end for java?
What is java net url?
What is java lang noclassdeffounderror?
What is ibatis in java?
What is exe file in java?
What is an interceptor in java?
How can I swap two variables without using a third variable?
What is singleton pattern in java?
What is contextpath in java?
What is hql in java?
What is javacpl?
Why java?
I get an exception if I remove the static modifier from main?
What is default constructor in java?
Which type of stream is in java?