CPSC 225, Spring 2012
Information About the Second Test

The second test will be given in class on Wednesday, April 4. The test will cover everything that we have done since the first test, up to Friday, March 30. This includes material from Chapter 10, Sections 10.1 to 10.4; Chapter 11, Sections 11.1 through 11.3 and a few parts of Section 11.4; Chapter 13, Subsections 13.1.1, 13.1.2, 13.1.3, and some ideas from Section 13.2. In addition, there might be some questions about CVS and/or the Eclipse debugger, and you might want to review the other labs as well. The format will be similar to the first test, with a mixture of definitions, essay-type questions, and coding questions.


Here are some terms and ideas that you should be familiar with:

generic programming
what problem does generic programming try to solve?
parameterized types; for example, ArrayList<T>, Map<String,String>
wrapper classes; Integer, Double, Boolean, etc.
using wrapper classes with parameterized types; for example, ArrayList<Integer>
methods in class Object: toString(), equals(x), hashCode()
"for-each" loops; for example:   for ( String str : strList )...
using a for-each loop to traverse a collection
the Comparable interface and the compareTo(x) method
the JCF (Java Collection Framework)
collections, lists, and sets
ArrayLists versus LinkedLists [differences; run times; when to use]
HashSets versus TreeSets [differences; run times; when to use]
maps
keys and values in maps
HashMaps versus TreeMaps  [differences; run times; when to use]
using the keySet() from a map to traverse the map
uses of lists, sets, and maps
using set methods retainAll(s), removeAll(s) to do set operations like intersection
implementing a symbol table as a map of type HashMap<String,Double>
using a symbol table to store values of "variables"
hash tables
implementing a hash table as an array of linked lists
hash codes and how they are used in a hash table
type erasure:  Parameterized types like ArrayList<String> don't exist at run time

Generic interfaces and classes in the Java Collection Framework:

    Collection<T>; methods:  add(x), remove(x), contains(x), size(), clear(), isEmpty()
       List<T>; methods:  get(index), set(index,x), remove(index)
          ArrayList<T>
          LinkedList<T>
       Set<T>
          HashSet<T>
          TreeSet<T>
        
    Map<K,V>; methods: put(k,v), get(k), containsKey(k), keySet()
       HashMap<K,V>
       TreeMap<K,V>  
       
streams for input and output
files
how streams and files are abstractions and why that is important
binary streams versus character streams
character sets and character encoding; for example, ISO-8859-1, UTF-8, UTF-16
InputStream and OutputStream
Reader and Writer
IOExceptions
PrintWriter:  the methods print(), println(), checkError()
files, directories, and file paths
the File class; methods;  exists(), length(), canRead(), canWrite(), isDirectory()
FileInputStream and FileOutputStream
using a Scanner to read from a text file
using a PrintWriter to write to a text file
designing a format for a data file
why use human readable (character) files?

computer network
IP address
domain name
protocol
TCP/IP
the client/server model

images and the Image class
BufferedImages
drawing an image with g.drawImage(image,x,y,null)
getting a graphics context for drawing to a BufferedImage; the createGraphics() method
resources
Graphics2D
the idea of antialiasing
TexturePaint and GradientPaint

CVS
sharing, importing, updating, and committing projects in CVS
how CVS makes it possible for programmers to work together on a project
how and why a debugger, such as the Eclipse debugger, is used