What is the need to declare main() method as static in Java?
Answer Posted / paletipatisrinu
public static void main(String k[]) here
public:The main method will be called by jvm.so jvm is
located some other place so invoke our main() should be public
static:before object is creation calling main() method so
the main() method will be called by using static
void:so jvm does not expected any return value
main():its method name
String[]:argument type is String
| Is This Answer Correct ? | 17 Yes | 6 No |
Post New Answer View All Answers
What is a java proxy?
What is an action class in java?
What is the difference between a jdk and a jvm?
What is the use of lambda functions?
What is @resource annotation in java?
What is dao in java?
What is war file in java?
What is meant by annotation in java?
What is meant by pass by reference and pass by value in java?
What is mime in java?
How can I write a program that takes command line input?
Can an application have multiple classes having main method?
What is aop java?
What is @override annotation in java?
Explain issues of old java date api?