Which of the following options, when inserted at //INSERT CODE HERE, will print out Main?
public class Main { // INSERT CODE HERE { System.out.println("Main"); } }
C
A is incorrect. This option defines a valid method but not a valid main method. The main method should be defined as a static method, which is missing from the method declaration in A.
B is incorrect. The square brackets are placed after the name of the method argument. The square brackets can be placed after either the data type or the method argument name. B is missing static keyword.
C is correct. Extra spaces in a class are ignored by the Java compiler.
D is incorrect. The main method accepts an array of String as a method argument. D only has a single String object.
E is incorrect. It doesn't specify the return type of the method. This line of code will not compile.