单项选择题
abstract class abstrctIt {
abstract float getFloat ();
}
public class AbstractTest extends AbstractIt {
private float f1= 1.0f;
private float getFloat () {return f1;}
}
What is the result?()
A. Compilation is successful.
B. An error on line 6 causes a runtime failure.
C. An error at line 6 causes compilation to fail.
D. An error at line 2 causes compilation to fail.
相关考题
-
单项选择题
Youwantsubclassesinanypackagetohaveaccesstomembersofasuperclass.Whichisthemostrestrictiveaccessmodifierthatwillaccomplishthisobjective?()
A. Public
B. Private
C. Protected
D. Transient
E. No access modifier is qualified. -
单项选择题
Whichwilldeclareamethodthatforcesasubclasstoimplementit?()
A. Public double methoda();
B. Static void methoda (double d1) {}
C. Public native double methoda();
D. Abstract public void methoda();
E. Protected void methoda (double d1){} -
单项选择题
public class foo { public static void main (String[]args) { String s; system.out.printIn (“s=” + s); } } What is the result?()
A. The code compiles and “s=” is printed.
B. The code compiles and “s=null” is printed.
C. The code does not compile because string s is not initialized.
D. The code does not compile because string s cannot be referenced.
E. The code compiles, but a NullPointerException is thrown when toString is called.
