Multiple choice technology web technology

Which of the following are valid method signature?

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

  2. public static void main()

  3. public void main(String[] args)

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

Reveal answer Fill a bubble to check yourself
A,B,C Correct answer
Explanation

Java main method must be static, but public is not strictly required (though runtime looks for public). Variations: A is standard, B is valid static main without args (compile-time valid, though JVM won't call it), C is valid non-public static main, D is invalid syntax (void must come before method name, not after).