Vocabulary
Static (or class) member variables (fields)
Static (or class) methods
Method/Constructor overloading
Method signature (name + parameter types)
Reference to an object
Pass by value (primitive types)
Pass by reference (objects)
Comparing objects (.equals)
Copy constructor
Aggregation
Deep vs shallow copying
null reference
"this" reference variable
Garbage collection
Topics
null
keyword and Null Pointer Exceptions
this
Vocabulary
array (1D, 2D, multi-dimensional)
Declaring an array
Accessing array elements
Initializing an array
Enhanced for-loop
Out of bounds problems
Calculating with arrays:
... comparing, summing, min/max, averages, swap elements
... sequential search, sorting
Arrays class
Arrays as arguments & parameters
Arrays of objects
Selection sort
Binary search
2D Arrays
... declaring
... obtaining number of rows/columns
... accessing elements
... as arguments & parameters
ArrayList class
... Creating and declaring an ArrayList
... Diamond syntax <>
... Auto-boxing/wrapping (e.g. Double, Integer)
Topics
Vocabulary
Inheritance, "Is a" relationship
superclass (or base class)
subclass (or derived class)
super()
Object class
extends
override
Polymorphism
Abstract (vs concrete) class
Interfaces
protected access
package access
inheritance hierarchy
overriding methods (e.g. equals)
instanceof operator
comparable interface
Topics
super()
in the first line of constructor
super.method_name()
anywhere in a subclass method.
Shape[] shapes = new Shape[3];
shapes[0] = new Circle(2);
shapes[1] = new Rectangle(2,3);
shapes[2] = new Square(5);
for (int i=0; i < shapes.length; i++) {
System.out.println("The area for " + shapes[i] + " is " + shapes[i].calcArea());
}
public abstract class Shape {
public abstract double calcArea();
...
Must define method in the subclass. Can't create a Shape object; can only create a subclass.
final
so that one can't override a method in the subclass.
Object
instanceof
operator can be used to check what type of object you have. For example, if you need to
cast an object. Should be used sparingly. Don't use as a way to implement different behavior, i.e. to bypass polymorphism.
implements
keyword.
Vocabulary
File
Ascii (text) file vs binary file
Opening a file
Closing a file
White space
Exception
Throwing an Exception
Catching an Exception
try-catch
Delimiter
Vocabulary
window
GUI
components - buttons, labels, textboxes
container - JFrame, JPanel
Java Foundation Classes
Abstract Windowing Toolkit (AWT)
Swing
Event
Event Driven
Event Listener
Event Object
Event Source
Event FiringAction Events
Action listener class
actionPerformed method
anonymous class
extending a class
implementing a class
Layout Manager