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
Is jar an executable?
In java thread programming, which method is a must implementation for all threads?
What are jpa annotations?
What is dependency injection in java?
Describe the principles of oops.
How do you count in java?
What is java api?
What is use of jpa?
Which class is the superclass of every class?
What is dialect in java?
In hibernate what is the difference between the Session and SessionFactory?
Which is more secure: java or activex? : java security
What is difference between loosely coupled and tightly coupled in java?
What is reflection in java?
What is custom tag in java?