java Commander
java com. sim. sjcp.Commander
java com/sun/sjcp/Commander
java -cp com.sun.sjcp Commander
java -cp com/sun/sjcp Commander
第1题:
A.public class MinMax<?> {
B.public class MinMax<? extends Number> {
C.public class MinMax<N extends Object> {
D.public class MinMax<N extends Number> {
E.public class MinMax<? extends Object> {
F.public class MinMax<N extends Integer> {
第2题:
Given two files, GrizzlyBear.java and Salmon.java:If both classes are in the correct directories for their packages, and the Mammal class correctly defines the findSalmon() method, which change allows this code to compile?()
A.add import animals.mammals.*; at line 2 in Salmon.java
B.add import animals.fish.*; at line 2 in GrizzlyBear.java
C.add import animals.fish.Salmon.*; at line 2 in GrizzlyBear.java
D.add import animals.mammals.GrizzlyBear.*; at line 2 in Salmon.java
第3题:
A.int foo() { /* more code here */ }
B.void foo() { /* more code here */ }
C.public void foo() { /* more code here */ }
D.private void foo() { /* more code here */ }
E.protected void foo() { /* more code here */ }
第4题:
You are working on a debug build of an application.You need to find the line of code that caused an exception to be thrown. Which property of the Exception class should you use to achieve this goal?()
第5题:
第6题:
A.public int compareTo(Object o){/*more code here*/}
B.public int compareTo(Score other){/*more code here*/}
C.public int compare(Score s1,Score s2){/*more code here*/}
D.public int compare(Object o1,Object o2){/*more code here*/}
第7题:
A.The application will crash.
B.The code on line 29 will be executed.
C.The code on line 5 of class A will execute.
D.The code on line 5 of class B will execute.
E.The exception will be propagated back to line 27.
第8题:
A.
B.
C.
D.
E.
F.
第9题:
class One { void foo() {} } class Two extends One { //insert method here } Which three methods, inserted individually at line 14, will correctly complete class Two?()
第10题:
Given a correctly compiled class whose source code is: package com.sun.sjcp; public class Commander { public static void main(String[] args) { // more code here } } Assume that the class file is located in /foo/com/sun/sjcp/, the current directory is /foo/, and that the classpath contains “.“ (current directory). Which command line correctly runs Commander?()