多项选择题
Given: What are four valid examples of polymorphic method calls?()
A.x.a2(); B.z.a2(); C.z.c1(); D.z.a1(); E.y.c1(); F.x.a1();
Given: What is the result?()A.peepB.barkC.meowD.Compil...
单项选择题
Given: What is the result?()
A.peep B.bark C.meow D.Compilation fails. E.An exception is thrown at runtime.
Given: Which change can you make to Target without aff...
Given: Which change can you make to Target without affecting Client?()
A.Line 4 of class Target can be changed to return i++; B.Line 2 of class Target can be changed to private int i = 1; C.Line 3 of class Target can be changed to private int addOne(){ D.Line 2 of class Target can be changed to private Integer i = 0;
Given a method that must ensure that its parameter is n...
Given a method that must ensure that its parameter is not null: 11. public void someMethod(Object value) { 12. // check for null value ... 20. System.out.println(value.getClass()); 21. } What inserted at line 12, is the appropriate way to handle a null value?()
A.assert value == null; B.assert value != null, "value is null"; C.if (value == null) { throw new AssertionException("value is null"); } D.if (value == null) { throw new IllegalArgumentException("value is null"); }