In Java why we write public static void main(String args[])
why not main()?
Answer Posted / anil kumar.kommmisetty
In java we using a main method
i.e public static void main(String args[])
public > This is used for any where we can access.
static > This is used for constat and then first compile to
start.
void > should not return any value.
main > where to start the compile the program to tell.
String > it is a class.
args[] > this is used to tell the when ever u enter the
data that is treated as arguments to that program.
Is This Answer Correct ? | 4 Yes | 4 No |
Post New Answer View All Answers
What is the size of boolean variable?
When would you use a static class?
What's the access scope of protected access specifier?
What is a local, member and a class variable?
What is the main method java?
what is interface in java? Explain
Why do we need data serialization?
What is the purpose of java?
What is a static class in java?
What is difference between overloading and overriding in java?
Can you declare a private method as static?
What are the difference between composition and inheritance in java?
Explain the difference between protected and default access.
What is multithreading in java?
What is Enum in Java?