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 is the difference between an if statement and a switch statement?
Does sprintf allocate memory?
Explain the transient field modifier?
What is the difference between conversation & casting?
What is jagged array in java?
How many JVMs can run on a single machine and what is the Just-In-Time(JIT) compiler?
Can we create an object of private class?
What is the difference between post and put?
What is the java virtual machine?
What is the use of predicate in java 8?
Why map is used in java?
What is the longest unicode character?
What is final modifier?
What is 16 bits called?
How to sort array in descending order in java?