In Java why we write public static void main(String args[])
why not main()?
Answer Posted / abhi
it is bcoz...
since MAIN is also a method and it is not called by creating instance it is declared STATIC so that it is invoked by the JVM without creating instance.....
PUBLIC because it is called by the jvm which is not is not a part of the class directly.....
VOID because it does not return any value.....
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Is it safe to install java on my computer?
What is the difference between checked exception and unchecked exception?
Is array serializable java?
Does unicode support all languages?
What is polymorphism java example?
What is difference between call by value and call by reference?
In a program, initializing an array of 100 KB is throwing an out of memory exception while there is 100 MB of memory available. Why?
What lambda means?
why we use merge option in hybernate pls give a ex snippet
What is a method in java?
Explain the concept of proper inheritance?
why are wait(), notify() and notifyall() methods defined in the object class? : Java thread
I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?
What is the use of keywords in java?
What is java util list?