In Java why we write public static void main(String args[])
why not main()?
Answer Posted / srinivas_cena
public- public isa access specifier,so we can use the method from out the class
static- static is a keyword which is used to calla methos with out creation of object for a class. so jvm directly runs from main() method.
void- main() method does not return any value so it has void data type.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the difference between serial and throughput garbage collector?
Why enumeration is faster than iterator?
Is it necessary that each try block must be followed by a catch block?
What's the difference between an abstract class and interface in java?
What are different types of control structures?
Can this keyword be used to refer static members?
What is a super method?
Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?
Can you explain inner class.
What is the difference between char and char *?
What is an interoperable application in java ?
How do you replace all in word?
Can a class be private or protected in java?
What is arrays fill in java?
What is data type in java?