站内搜索
1Z0-853 问题列表
问题
多选题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 result if the default locale is Locale.US?()AThe value of b is 2.00.BThe value of a is 3.141.CThe value of a is 3.14.DThe value of b is 2.0000.EThe value of a is 3.1415.FThe value of a is 3.1416.GThe value of b is 2.
问题
多选题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 result if the default locale is Locale.US?()AThe value of b is 2.00.BThe value of a is 3.141.CThe value of a is 3.14.DThe value of b is 2.0000.EThe value of a is 3.1415.FThe value of a is 3.1416.GThe value of b is 2.
问题
单选题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 = new B(); 19. a.process(); 20. } What is the result? ()A
Compilation fails because of an error in line 19.B
An exception is thrown at runtime.C
BD
Compilation fails because of an error in line 18.E
Compilation fails because of an error in line 15. F
The code runs with no output.
问题
多选题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
问题
多选题Which two code fragments correctly create and initialize a static array of int elements?()AABBCCDD
问题
单选题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.println(numbers); 19. } Which line of code marks the earliest point that an object referenced by intObj becomes a candidate for garbage collection?()A
Line 19B
The object is NOT a candidate for garbage collection.C
Line 17D
Line 16E
Line 18
问题
单选题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 an error in line 13.B
A ClassCastException is thrown at runtime.C
1 2 3D
Compilation fails because of an error in line 14.E
Compilation fails because of an error in line 12.
问题
单选题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.println(numbers); 19. } Which line of code marks the earliest point that an object referenced by intObj becomes a candidate for garbage collection?()A
Line 19B
The object is NOT a candidate for garbage collection.C
Line 17D
Line 16E
Line 18
问题
多选题Which two code fragments correctly create and initialize a static array of int elements?()AABBCCDD
问题
单选题Given: What is the result?()A
An exception is thrown at runtime.B
r, e, o,C
Compilation fails.D
r, t, t,
问题
单选题Given: 11. String test = "This is a test"; 12. String[] tokens = test.split("/s"); 13. System.out.println(tokens.length); What is the result?()A
An exception is thrown at runtime.B
1C
4D
Compilation fails.E
0
问题
单选题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 fails because of an error in line 9.D
If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 9.E
Compilation fails because of an error in line 3.F
Compilation fails because of an error in line 7.
问题
单选题Click the Exhibit button. Given this code from Class B: 25. A a1 = new A(); 26. A a2 = new A(); 27. A a3 = new A(); 28. System.out.println(A.getInstanceCount()); What is the result?()A
Compilation of class A fails.B
Line 28 prints the value 3 to System.out.C
Line 28 prints the value 1 to System.out.D
Compilation fails because of an error on line 28.E
A runtime error occurs when line 25 executes.
问题
多选题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 implements Jumper{ 51. public void jump() {} 52. }. Which three are true?()ACat is-a JumperBCat is-a AnimalCDog is-a JumperDDog is-a AnimalEBeagle has-a JumperFCat has-a AnimalGBeagle has-a Tail
问题
单选题Click the Exhibit button. Given: ClassA a = new ClassA(); a.methodA(); What is the result?()A
The code runs with no output.B
Compilation fails.C
An exception is thrown at runtime.D
ClassC is displayed.