Test 2 Review Checklist
These are the new topics covered since around Test 1 (or topics
covered close to when Test 1 occurred and so were not asked about
very much on Test 1).
Files and Streams
- Understand what streams are
- input streams vs. output streams
- byte streams vs. character streams
- formatted text files vs. binary files
- sequential files vs. random-access files
- InputStream, OutputStream, Reader, Writer classes (know which are
byte streams and which are character streams)
- understand the use of class File
- File stream classes (byte and char)
- Buffered streams
- Know how to open an input file and read data from it
(read() method)
- Know how to open an output file and write data to it
(write() method)
- Understand the uses of special classes like Formatter and
Scanner, especially in the reading and writing of
files
- Know the predefined stream objects System.out,
System.in, and System.err
- Understand what object serialization is (for writing and reading
objects to and from files). This includes understanding:
- interface Serializable
- classes ObjectOutputStream and
ObjectInputStream
Tools
- Understand packages, how to use the import statement to
bring a class or package into a program, and that java.lang
is automatically part of every program
- Understand how to use the package statement to place a
class into a programmer-defined package. This includes understanding
some javac and java command line options:
- -d : for specifying where the result of a javac
command will be placed. Also helps build a package hierarchy
- -classpath : for specifying the locations of all classes
or
packages needed (for both javac and java)
Generics
- Generic methods
- How to declare them
- Type parameters (and their format and usage)
- Type erasure
- Upper bounds on type parameters
- Generic classes
- How to declare
- How to use (creating objects, etc)
- raw types (creating an instance of a generic class without the type
argument - for backwards compatibility)
- How to pass objects with generic types into methods
- Wildcards in type parameter lists
- ?, along with possibly extends or
super
Collections Framework
- Understand the basic makeup of it
- Interfaces - representing abstract data types
- Implementations - reusable data structures
- Algorithms - methods reusable across multiple implementations
- Understand the common interfaces and classes
- lists (vectors & arrays, linked lists)
- stacks and queues
- sets, maps (implemented with hash tables and trees, usually)
- Know how to create instances of them (implemented as generics), and
understand general usage.
- Algorithms are static methods in class Collections
Inner Classes and Nested Classes
-
Understand the concept of an inner class (and general nested
class), along with their relationship with enclosing class.
-
Understand the difference between inner classes and static nested
classes
-
Know what an inner class '.class' file looks like
- Know what an anonymous inner class is
- Understand the usage of inner classes in the GUI event handling
examples we've seen
Graphics class, paint(), paintComponent() - Chapter 12
- Understand the paint() method, which comes from
class Component (so every GUI component has this method
available)
- Understand when paint() (or paintComponent()) is
called (it's event driven), and how the
programmer can force painting to be done explicitly
(repaint())
- Understand the parameter of
paint() (and paintComponent()) - i.e.
(Graphics g) - and what kinds of things can be done with
it
- Understand the basics of the helper classes Color,
Font, and Polygon
- Understand what kinds of things can be drawn with the Graphics class
methods (strings, lines, ovals, rectangles, polygons, etc) and how
these basic drawing functions work.
- This includes the basic draw and fill methods
for each of these kinds of items
- Understand the difference between the Graphics and
Graphics2D classes
- Understand the Graphics2D methods draw() and
fill(), as well as what types of things constitute
Shapes that can be passed in
- Understand the basic shape types in the Java2D framework, including
GeneralPath
GUI Components, Events, Layouts (Swing Libraries)
- Under stand the code examples in the two textbook chapters on GUI
components
(we've looked through these in class)
- Understand the common components and containers in the Swing
libraries
- Be able to differentiate between components and containers
- Know the three types of top-level containers (JFrame, JApplet,
JDialog)
- Know what other basic containers are available, and can be embedded
inside other containers - especially the use of JPanel
(these also include things like JTabbedPane, JDesktopPane,
JInternalFrame, etc)
- Understand the components discussed in class (i.e. seen in
the textbook's examples)
- be able to recognize various types of
components and distinguish between them.
- Understand how event handling works, as well as the basic event
handler interfaces discussed and seen in examples:
- ActionListener
- ItemListener
- ListSelectionListener
- MouseListener (5 mouse events)
- MouseMotionListener (2 motion events)
- KeyListener (3 key events)
- Understand the use of ActionListener with the
javax.swing.Timer class, and how it's used to fire an event
at a timed interval (rather than a user action)
- Understand the layout managers discussed and be able to
differentiate between them. The primary ones we looked at in
examples were:
- FlowLayout
- BorderLayout
- GridLayout
- BoxLayout
- GridBagLayout
- Also understand the use of the validate() method to
re-layout a container, if something on it has changed since it was
previously displayed on screen
- How to embed an image in such a way that it can also be loaded from
a jar file