Test 2 Review Sheet
General
-
Know all the keywords covered so far in the course
-
Know how to properly declare the 'main' method used to invoke a class
Classes and Objects (chapter 8)
- Objects and classes and the relationship between them
- Constructors: what they are and how to build them
- The modifiers public and private
- The static modifier, and the difference between
static variables and methods vs. instance variables and methods, as
well as which variables can be accessed from which methods
- Understand how to declare an object reference variable and
then create the object with
new
, along with how
to invoke the chosen constructor
- Understand how objects are passed in and out of methods
- Class scope vs. local scope (like in a method)
- The keyword this
- Arrays of objects (array of reference variables, each can attach to
an object
Strings (chapter 11)
-
Know the common String methods: length(), concat(), equals(),
compareTo(), charAt(), substring(), trim(), toLowerCase(),
toUpperCase(), replace()
-
Know the common StringBuffer methods: construction from a String,
append(), insert(), delete(), length(), charAt(), substring()
-
Understand that a String is immutable. A StringBuffer is mutable.
-
Know what the StringTokenizer class is for. Be able to interpret
given code involving String tokenization. (constructor,
countTokens(), nextToken())
-
Understand how to process command line arguments
Inheritance and Polymorphism (chapters 9 and 10)
- Superclasses and subclasses, and deriving a class
with the keyword extends
- The use of super to invoke parent constructors
and methods
-
Understand overriding methods in derived classes
- Every class derived somehow from class Object. Understand
the 3 special methods inherited from Object by every class:
- equals()
- toString()
- clone()
- Understand the modifiers protected and final, and
what they do when applied to class data and methods
-
Abstract classes and their relationship with abstract methods
- Understand polymorphism and dynamic binding
- How base class variables can be attached to derived class objects
- How base class methods can be overridden in derived classes
- How dynamic binding allows method calls (through base class
variables) to still invoke child versions of overridden
methods
- When casting is necessary between parent and child, and when it is
not
-
Understand interfaces, how to declare one and how to extend one
-
Know how a class declares that it will implement an interface
-
Understand relationship of data and methods with interfaces
- Understand the basic interfaces discussed in examples
(Comparable and Clonable)
-
Understand the concept of an inner class, along with
their relationship with enclosing class.
-
Know what an inner class '.class' file looks like
Exception Handling (chapter 15)
-
Understand Exceptions, understand differences between
checked exceptions, unchecked exceptions, and errors
-
Understand try, catch, finally blocks and relationship
between them
-
Understand the throws and throw keywords and when to
use both
-
Custom exception types can be built, derived from Exception or one of
its derived classes
Applets, GUI, basic Event Handling
- Understand that applets are extended from Applet or
JApplet
- Understand the special methods used by applets, and when they are
invoked. These are: init, start, paint,
stop, and destroy
- Know how to embed an applet in a web page, whether it's a single
.class file or in a jar archive.
- Understand the usage of the ActionListener interface to
handle basic actions. The ActionListener interface
contains the one abstract method:
void actionPerformed(ActionEvent a)
- Be able to read and understand the Applet and GUI examples from
Deitel chapters 3 - 8