OCA Java SE 8 Mock Exam Review - OCA Mock Question 37
Question
What would be the results of compiling and running the following class.
class test {
public static void main() {
System.out.println("test");
}
}
- The program does not compile as there is no main method defined.
- The program compiles and runs generating an output of "test"
- The program compiles and runs but does not generate any output.
- The program compiles but does not run.
Answer
Note
The following main method
public static void main() {
should be changed to
public static void main(String[] argv) {