CS 124, Fall 2009
Information on the Second Test

The second and final in-class test for this course takes place on Monday, November 9. It will concentrate on material that has been covered since the first test (but since the newer material builds on the older, you still need to know the earlier stuff). The format will be similar to the first test. The test will be four pages long. It can include definitions and short answer questions similar to those given on the quizzes; longer essay-type questions; questions that ask you to write code segments, subroutines, classes, or complete programs; and questions that ask you to determine the purpose or the output of some given code.

The test covers all of Chapter 4; Chapter 5, Sections 1 through 4; and Chapter 7, Sections 7.1, 7.2.1, 7.5.1, and 7.5.2. Topics include subroutines, the basics of classes, and the basics of one- and two-dimensional arrays.

Here is a list of some of the things that you should know about:

subroutines
black boxes
interface and implementation
contract of a subroutine
subroutine call statements
static
access modifiers
public and private
return type
void
the parameter list of a subroutine
member variables
static subroutines and static member variables
accessing a static subroutine or member variable in another class
default initial values for member variables
global variables versus local variables.
dummy parameters (also known as formal parameters)
actual parameters
overloading (of subroutine names)
throwing exceptions in subroutines
IllegalArgumentException
functions
the return type of a function
return values
the return statement in functions
using a return statement in a void subroutine

top-down design and bottom-up design
API (Application Programming Interfaces)
packages
the package java.lang
the import directive, such as "import java.util.Scanner;" or "import java.awt.*;"
Javadoc and Javadoc-style comments

combining declaration and initialization, as in "int count = 0;"
named constants and the "final" modifier
why named constants should be used
scope
a local variable or parameter name can hide a member variable

methods
instance variables and instance methods
how to refer to the instance variables and instance methods in an object
the relationship between classes and objects
class names as types (used for declaring variables, parameters, and return types)
pointers (also known as references)
variables do not hold objects; they hold pointers to objects
null
objects in assignment statements
comparing objects with == and !=
why instance variables should usually be private
getter and setter methods
constructors
the default constructor in a class that does not define a constructor explicitly
calling a constructor with the new operator
parameters in constructors
defining multiple constructors in a class (constructor overloading)
garbage collection
object-oriented programming
designing classes
object-oriented analysis and design
instance variables represent the "state" of an object
instance methods represent the "behaviors" of an object

arrays
elements of an array
length of an array
index of an element in an array
ArrayIndexOutOfBoundsException
array types such as int[] and String[]
creating arrays with the new operator
using for loops to process arrays
random access to array elements
two-dimensional arrays
using nested for loops to process two-dimensional arrays