Review Questions: PrintWriter Never taught this, just had you learn it on your own BufferedImage Not on test in any way subimages We won't make you re-write your homework "Write a method that, given an image and a Rectangle, returns the brightest color in that Rectangle of the image" What should I know String: length, charAt, indexOf, substring, contains ArrayList: size, get, add, contains Math: pow, sqrt Scanner: all the next/hasNext things URL: openStream print, println Color: get/set Red/Green/Blue Rectangle: x,y,w,h Picture: getPixel, setTitle, show Pixel: get/set Color/Red/Green/Blue/Average (not an exhaustive list... if we used it in several assignments and lectures, we expect you to know it) Activation Records Info one method has on the stack where to return to what the parameter and local variables' values are Stack a stack of Activation Records, with one on top where running methods are stored StackOverflowException - had too many activation records (usually infinite recursion) Recursive method Have 3 characteristics: base case, a recursive case, make progress (see code for examples) Heap where we store objects and arrays new puts something on the heap (so does "hi", {1,2,3}) Pass-by-value We copy the contents of variables when we call methods int x = 7; someMethod(x); System.out.println(x); // will always print 7 int[] y = {7}; someMethod(y); System.out.println(y[0]); // might print anything System.out.println(y.length); // will always print 1 2D arrays are arrays of arrays but arrays are on the heap, so really arrays of locations of arrays int[][] w = {{1,2,3},{4,5}}; w.length == 2 w[0].length == 3 w[1].length == 2 w[0][0] == 1 w[1][1] == 5 w[0][2] == 3 int[] x = w[0]; is an array containing 1,2,3 w[1] = w[0]; // after this, w[1][i] and w[0][i] are the same memory Conceptually, an image is a Color[][] In practice, we used Picture which is more like a 2DArrayList switch looks like switch(x) { case 3: stuff1; break; case 4: stuff2; break; // and so on default: stuff3; } and it means if (x == 3) { stuff1 } else if (x == 4) { stuff2 } // and so on else { stuff3 } sorting Merge sort took n*log(n) time to sort n things That is faster than bubble and selections which take n*n You should also be able to talk about the high-level algorithm class diagram creation we spent days on this; look there