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

//Other methods are not shown. }
37. You are given the information that BlockLetter is an abstract class that is used in the program. Which of the following can you conclude about the class?
I II
III
All of its methods must be abstract.
It must have at least one subclass.
No instances of BlockLetter can be created.
(A) I only
(B) II only
(C) III only
(D) II and III only (E) I, II, and III
38. Which is a true statement about method drawLetters?
(A) It is an overloaded method in the Banner class.
(B) It is an overridden method in the Banner class.
(C) It uses polymorphism to draw the correct letters.
(D) It will cause a compile-time error because draw is not
implemented in the BlockLetter class.
(E) It will cause a run-time error because draw is not
implemented in the BlockLetter class.
39. Consider method1 and method2 below, which are identical except for the second last line of code. Each method returns a new matrix based on the input matrix mat.
public static int[][] method1(int[][] mat) {
int numRows = mat.length;
int numCols = mat[0].length;
int[][] newMat = new int[numRows][numCols]; for (int row = 0; row < numRows; row++)
for (int col = 0; col < numCols; col++)










































































   553   554   555   556   557