Review for Test 2

No event handling in test 2!

Format of the test: Instead:

Requires some (but very little) memorization

public class MyApplication
{  public static void main(String[] args)
   {
   }
}

public class MyClass [extends MySuperclass implements MyInterface]
{  public MyClass(...)  // constructor
   {  // usually initializes instance variables
   }

   public type myMethod(...)
   {
   }

   private type myInstanceVariable;  // instance variable
}
Details are the topic of (chapter 3), chapter 7, and chapter 9.

for Loops

for (int i = 0; i < n; i++)
{  ...
}

while loop

while (condition)
{  ...
} Common problems

Random Numbers

Random generator = new Random();
int d = 1 + generator.nextInt(6);

Method parameters

Can modifications of parameters done within the method affect the calling program?

Accessor / Mutator methods

Keyword static

Scope of a variable

Recursion

Testing

Debugging

General strategies

Inheritance

When to use it

Overriding

Overloading

Upcasting

Downcasting

Polymorphism

Interfaces

Superclass Object

Events

3 classes involved

Callback

Adapter

Inner Classes

Make sure to understand sample code!