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 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 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"); }
单项选择题A team of programmers is involved in reviewing a proposed design for a new utility class. After some discussion, they realize that the current design allows other classes to access methods in the utility class that should be accessible only to methods within the utility class itself. What design issue has the team discovered?()
A.Tight coupling B.Low cohesion C.High cohesion D.Loose coupling E.Weak encapsulation
单项选择题Given: 11.double input = 314159.26; 12.NumberFormat nf = NumberFormat.getInstance(Locale.ITALIAN); 13.String b; 14. insert code here Which code, inserted at line 14, sets the value of b to 314.159,26?()
A.b = nf.parse( input ); B.b = nf.format( input ); C.b = nf.equals( input ); D.b = nf.parseObject( input );
单项选择题Given: If an instance of class Beagle is created,then Serialized,then deSerialized, what is the result?()
A.ad B.ada C.add D.adad