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 vector?
In java, how many ways you can take input from the console?
What is difference between float and double?
What is a singleton factory?
Is null an object java?
How many types of variables are there?
Can you call a method in a method?
What do you know about the garbate collector?
In which language java is written?
What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
Assume a thread has lock on it, calling sleep() method on that thread will release the lock?
What is the method overriding?
How many times finalize method will be invoked? Who invokes finalize() method in java?
What is consumer in java?
Is java developer a good career?