In Java why we write public static void main(String args[])
why not main()?
Answer Posted / kedar
static methods can be accessed without creating object object of class, we know that file name of java program is "classname.java", "classname" is the class which contain main function, so it is easier for compiler to locate class which contain main(), and because of static nature it can execute it.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the integer of 16?
How does hashset works in java?
Can a main method be declared final?
What restrictions are placed on method overloading?
Do loops java?
What is object class in java?
Can you extend main method in java?
What is method overloading with type promotion?
If we don’t want some of the fields not to serialize how to do that?
What is array pointers ?
Is it possible to override private or static method in java?
Why is java architectural neutral?
What are the restrictions imposed by a Security Manager on Applets?.
what is difference between equals and ==?
What is the difference between the prefix and postfix forms of the ++ operator?