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
differences between iterator and spliterator in java se 8?
Why java?
What is jersey in java?
What is javacpl?
What is @resource annotation in java?
What is an actionevent in java?
When is static variable loaded? Is it at compile time or runtime? When exactly a static block is loaded in java?
Is lambda expression an object?
What is an action class in java?
What is ibatis in java?
Spring framework ---Can somebody explain me in easily understandable format about AOP, IOC and DI, so that i can explain in interview rather than just telling what is available in net. I am not able to understand that also. I am new to Spring
Why we use beans in java?
What is rxjava2?
How to reverse the singly linked list(In Node data members are(int data,int pointerTONext))
What is the difference between deep copy and shallow copy in java