Multiple choice technology programming languages

Which of the following are valid main method declarations?

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

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

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

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

  5. public static void main (String [], int argv)

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

Valid main method signatures must be public static void with a single String array or varargs parameter. Modifier order (static public vs public static) is flexible. Parameter names can be any valid identifier. Return type must be void, and only one String array/varargs parameter is allowed.