In Java why we write public static void main(String args[])
why not main()?
Answer Posted / suresh.t.c
public static void main(String arg[])
public for accessing all object
static for to call main method without instance
void main for not returning values for avoid compilation errors
String arg[] is ,in input takes as strings so takes multiple inputs declared String with array of arg[]
| Is This Answer Correct ? | 14 Yes | 3 No |
Post New Answer View All Answers
What are latest features introduced with java 8?
Is java same as core java?
How do you start a new line in java?
What is the function of static in java?
What are the advantages of autoboxing?
What are the basic interfaces of java collections framework?
What is lazy programming?
Does java map allow duplicates?
Define how does a try statement determine which catch clause should be used to handle an exception?
Write a regular expression to validate a password. A password must start with an alphabet and followed by alphanumeric characters; its length must be in between 8 to 20.
What is quick sort in java?
What are the two parts of a conditional statement?
how can you catch multiple exceptions in java?
What is linkedlist in java?
What is io stream in java?