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 does flag mean in java?
What is java used for?
How does list work in java?
Can we override static methods in java?
What is thread safe in java?
What is multithreading and its advantages?
What is the difference between a constructor and a method?
Name some classes present in java.util.regex package.
Why synchronization is important?
In java, how we can disallow serialization of variables?
What happens if we don’t override run method ?
What is Java Annotations?
what is collatration?
Can set contain duplicates?
What is the size of arraylist in java?