单项选择题
A. Compilation fails.
B. hello from a
C. hello from b
D. hello from b hello from a
E. hello from a hello from b
多项选择题 Whichtwoarebenefitsoffullyencapsulatingaclass?()
单项选择题 class A { public byte getNumber() { return 1; } } class B extends A { public short getNumber() { return 2; } public static void main(String args[]) { B b = new B(); System.out.println(b.getNumber()); } } What is the result?()
多项选择题 1. class BaseClass { 2. private float x = 1.of; 3. protected float getVar() { return x; } 4. } 5. class SubClass extends BaseClass { 6. private float x = 2.Of; 7. // insert code here 8. } Which two are valid examples of method overriding when inserted at line 7?()