Given:



and commands:

javac MainTest.java
java MainTest 1 2 3

What is the result?

A.

int main 1

B.

Object main 1

C.

String main 1

D. Compilation fails
E. An exception is thrown at runtime

題解

程式進入點為「public static void main(String[] args)」或是「public static void main(String... args)」,因此這題會執行第11行的main方法。