Page 420 - AP Computer Science A, 7th edition
P. 420
public class Image {
private private private private columns
final int BLACK = 1; final int WHITE = 0; int[][] image;
int size;
//square grid //number of rows and
public Image() //constructor { /∗ implementation not shown ∗/ }
public void display() //displays Image { /∗ implementation not shown ∗/ }
/∗∗ Precondition: Image is defined with either BLACK or WHITE cells.
∗ Postcondition: If 0 <= row < size, 0 <= col < size, and
∗ image[row][col] is BLACK, set all cells in the
∗ same blob to WHITE. Otherwise image is unchanged.
∗ @param row the given row
∗ @param col the given column ∗/