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
Why is core java important?
Can we declare register variable as global?
How to create com object in Java?
When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?
Which is fastest collection in java?
Does java isempty check for null?
What is a superclass?
what do you mean by marker interface in java?
Is java a pure object oriented language?
What are class types in java?
What is the difference between method overriding and overloading?
What are the different types of inheritance in java?
What is difference between path and classpath?
Can static methods access instance variables in java?
Which list is sorted in java?