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 the access modifiers available in java?
How can we find the sum of two linked lists using stack in java?
What are the different types of data structures in java?
What access modifiers can be used for class ?
whatis Home interface and Remoteinterface? with example?
What is void in java?
How would you format a date in java? I.e. In the ddmmyyy format?
Write a java program that prints all the values given at command-line.
What are different types of references?
What is classname class in java?
How destructors are defined in java?
Explain the term virtual machine?
Explain with example the concept of constant variable in java.
Does java vector allow null?
What is derived datatype?