多项选择题

Given:  
11. // insert code here  
12. private N min, max;  
13. public N getMin() { return min; }  
14. public N getMax() { return max; }  
15. public void add(N added) {  
16. if (min == null || added.doubleValue() < min.doubleValue()) 
17. min = added;  
18. if (max == null || added.doubleValue() > max.doubleValue()) 
19. max = added;  
20. }  
21. }  
Which two, inserted at line 11, will allow the code to compile?()


A.A
B.B
C.C
D.D
E.E
F.F


您可能感兴趣的试卷

你可能感兴趣的试题

1.多项选择题

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?()

A. The value of b is 2.00.
B. The value of a is 3.141.
C. The value of a is 3.14.
D. The value of b is 2.0000.
E. The value of a is 3.1415.
F. The value of a is 3.1416.
G. The value of b is 2.

2.单项选择题

Click the Exhibit button.  
What is the output of the program shown in the exhibit? ()

A. 300-300-100-100-100
B. 300-300-300-100-100
C. 300-300-300-300-100
D. 300-100-100-100-100

3.单项选择题

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.

4.单项选择题

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. B
D. 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.

5.单项选择题

Given:  
12. System.out.format("Pi is approximately %d.", Math.PI);  
What is the result?()

A. An exception is thrown at runtime.
B. Pi is approximately 3.
C. Pi is approximately 3.141593.
D. Compilation fails.

9.单项选择题

Given:

What is the result?()

A. An exception is thrown at runtime.
B. r, e, o,
C. Compilation fails.
D. r, t, t,

10.单项选择题

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.

最新试题

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?()

题型:多项选择题

Given: Which code, inserted at line 15, creates an instance of the Point class defined in Line?()

题型:单项选择题

Given:  11. // insert code here  12. private N min, max;  13. public N getMin() { return min; }  14. public N getMax() { return max; }  15. public void add(N added) {  16. if (min == null  added.doubleValue() < min.doubleValue()) 17. min = added;  18. if (max == null  added.doubleValue() > max.doubleValue()) 19. max = added;  20. }  21. }  Which two, inserted at line 11, will allow the code to compile?()

题型:多项选择题

Given:What is the result?()

题型:单项选择题

Given:What is the result? ()

题型:单项选择题

Given:  12. System.out.format("Pi is approximately %d.", Math.PI);  What is the result?()

题型:单项选择题

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?()

题型:多项选择题

Given:Which five methods, inserted independently at line 5, will compile?()

题型:多项选择题

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?()

题型:多项选择题

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?()

题型:单项选择题