问题:单选题Given: What is the result of calling search with a valid List implementation? ()A 0B The result is undefined.C aD 2E 1F cG b...
查看答案
问题:单选题Given: 11. public static void main(String[] args) { 12. Object obj = new int[] { 1, 2, 3 }; 13. int[] someArray = (int[])obj; 14. for (int i : someArray) System.out.print(i + " "); 15. } What is the result? ()A Compilation fails because of...
问题:单选题Given: What is the result?()A An exception is thrown at runtime.B r, e, o,C Compilation fails.D r, t, t,...
问题:单选题Click the Exhibit button. What is the result?()A The code will deadlock.B The code may run with output "2 0 6 4".C The code may run with no output.D The code may run with output "0 6".E An exception is thrown at runtime.F The code may run...
问题:多选题Which two code fragments correctly create and initialize a static array of int elements?()AABBCCDD...
问题:单选题Given: What is the result?()A If you define D e = new E(), then e.bMethod() invokes the version of bMethod() defined in Line 5.B If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 5.C Compilation...
问题:单选题Given: 11. public void genNumbers() { 12. ArrayList numbers = new ArrayList(); 13. for (int i=0; i10; i++) { 14. int value = i * ((int) Math.random()); 15. Integer intObj = new Integer(value); 16. numbers.add(intObj); 17. } 18. System.out...
问题:多选题Given: 12. NumberFormat nf = NumberFormat.getInstance(); 13. nf.setMaximumFractionDigits(4); 14. nf.setMinimumFractionDigits(2); 15. String a = nf.format(3.1415926); 16. String b = nf.format(2); Which two statements are true about the resul...
问题:单选题Given: 11. static class A { 12. void process() throws Exception { throw new Exception(); } 13. } 14. static class B extends A { 15. void process() { System.out.println("B "); } 16. } 17. public static void main(String[] args) { 18. A a ...
问题:多选题Given: 10. interface Jumper { public void jump(); } ... 20. class Animal {} ... 30. class Dog extends Animal { 31. Tail tail; 32. } ... 40. class Beagle extends Dog implements Jumper{ 41. public void jump() {} 42. } ... 50. class Cat...
问题:多选题A JavaBeans component has the following field: 11. private boolean enabled; Which two pairs of method declarations follow the JavaBeans standard for accessing this field?()AABBCCDD...
问题:多选题Given: Which five methods, inserted independently at line 5, will compile?()Aprotected int blipvert(long x) { return 0; }Bprotected long blipvert(int x) { return 0; }Cprivate int blipvert(long x) { return 0; }Dprivate int blipvert(int x) { return 0; }E...