单项选择题
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
相关考题
-
多项选择题
Given: Which three are valid?()
A.p0 = p1;
B.p1 = p2;
C.p2 = p4;
D.p2 = (ClassC)p1;
E.p1 = (ClassB)p3;
F.p2 = (ClassC)p4; -
单项选择题
Given: What is the result?()
A.Compilation fails.
B.Cannot add Toppings
C.The code runs with no output.
D.A NullPointerException is thrown in Line 4. -
单项选择题
Given: What is the result?()
A.Hello
B.Hello World
C.Compilation fails.
D.Hello World 5
E.The code runs with no output.
F.An exception is thrown at runtime.
