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 the meaning of loosely coupled in java?
Is it correct to say that using parentheses can only change?
What is optional in java 8? What is the use of optional?advantages of java 8 optional?
What is ehcache in java?
Why is class forname used in java?
What is an api in java?
Is jar an executable?
How to reverse the singly linked list(In Node data members are(int data,int pointerTONext))
What is map and flatmap?
What is a service layer in java?
I want to control database connections in my program and want that only one thread should be able to make database connection at a time. Define how can I implement this logic?
What is war file in java?
Do I need both jdk and jre?
What type of parameter passing does java support?
What is explicit casting?