Computer Science, asked by bishtyogesh404, 21 days ago

Is the below statement correct? private static void main(String args[]) { } in ye or no

Answers

Answered by swapnilmanekar2
13

public static void main(String[] args)

Answered by AneesKakar
1

Is the below statement correct? private static void main(String args[]) :

No.

  • The correct statement is public static void main(string args[]).

  • We should use public in the command because this modifies the access to the main program and at the run time of the java program it can execute the main method.
  • public static void main(string args[]) is the instruction to start the main function in Java.
  • Here, the command string args[] indicates that an array of characters or strings will go to the main program in a sequential format.

Similar questions