Multiple choice

What is the standard signature for the main method?

  1. public void main(String args[])

  2. public void static main(String args[])

  3. public static void main(String args[])

  4. public static void main()

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The standard entry point for a Java application is public static void main(String args[]) (or String[] args). It must be public so the JVM can access it, static so it can be called without instantiating the class, void because it returns no value, and must accept an array of Strings as arguments.