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 constructor has no return type?
EDS (Electronic Data Systems India Pvt Ltd) at Chennai on 16-12-2006.
What is sleep method?
What is stored procedure. How do you create stored procedure ?
What is use of set in java?
Can we extend private class in java?
Can we create a constructor in abstract class?
What was java originally called?
List down the methods and interfaces of collection class in java.
What is the range of a character variable?
Outline the major features of java.
What is anagram in java?
What happens if we override private method?
What are the pillars of java?
Explain all java features with real time examples