Page 44 - AP Computer Science A, 7th edition
P. 44

public void secondTestMethod() {
for (int element : testArray) {
increment(element);
System.out.print(element + " "); }
} }
13. What output will be produced by invoking firstTestMethod for a Tester object?
(A) (B) (C) (D) (E)
3 4 5
4 5 6
5 6 7
0 0 0
No output will be produced. An ArrayIndexOutOfBoundsException will be thrown.
14. What output will be produced by invoking secondTestMethod for a Tester object, assuming that testArray contains 3,4,5?
(A) (B) (C) (D) (E)
3 4 5
4 5 6
5 6 7
0 0 0
No output will be produced. An ArrayIndexOutOfBoundsException will be thrown.
Ques t ions 15– 17 ref er t o t he Point, Quadrilateral, and Rectangle classes below:















































































   42   43   44   45   46