Multiple choice technology programming languages

Which of these are valid declarations of the main() method in order to start the execution of a Java application?

  1. static public void main(String[] args) { /* ... */ }

  2. public static int main(String[] args) { /* ... */ }

  3. public static void main(String args) { /* ... */ }

  4. public int main(Strings[] args, int argc) { /* ... */ }

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

Java's main method must be public, static, void, and accept String[] as parameter. The order of public and static can be swapped. Options B and D incorrectly use int as return type, while C uses String instead of String[].