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
Can the main method be overloaded?
What is web container in java?
Which is best framework in java?
Is java singleton thread safe?
What is an api in java?
Are streams faster than for loops?
What is Map,List,hashtable,ArrayList and difference between them??
What is java web application?
What is a java proxy?
Can the main method be declared final?
What is adoptopenjdk?
What are the Advantages of java se 8 new features?
Define network programming?
Why is lambda expression used?
What is interceptor in java?