Introduction to Java
History of Java
Java Strengths
Java Weaknesses
What You Need to Write Java
Types of Java Programs
Java Comments
Java Naming Conventions
Java Keywords
General Code Structure
A Simple Java Program
The Java Development Cycle
Object-Oriented Programming
Java Class Structure
Java Types and Variables
Declaration and Initialization
Java Methods
The "return" Keyword
Object Constructors and "new"
Java Packages and "import"
GUI Hello World
Web of Communicating Objects
Multiple Classes in the Same File
Review: Introduction to Java
Lab: Introduction to Java
Java Data Types
Primitive Types
Special Literal Values
Operators
Non-primitive Types: Classes
Classes: Types and Modules
Assigning Primitives vs. Objects
Changing Primitives vs. Objects
Strings: a Special Class
Assignments & String Immutability
Variable Scope
Declaration and Initialization
Initialization Defaults
Instance vs. Static Variables
Classes Extension and Inheritance
Inheritance Hierarchies
Legal Assignments to Variables
Explicit Casts
Casting of Primitives
Review: Java Data Types
Lab: Java Data Types
Java Methods
Classes: Modules and Types
Java Methods
The "return" Keyword
Calling a Method
Static Methods
Encapsulation and Privacy
Accessor and Mutator Methods
Encapsulation in the Java API
The "this" Keyword
A Complete Class
Overloading Methods
Calling Overloaded Methods
Calls to Other Overloaded Methods
Methods and Inheritance
Overriding Methods
Calls to Superclass's Methods
Overriding vs. Overloading
Reference Type vs. Object Type
Pass by Value vs. Reference
Review: Java Methods
Lab: Java Methods
Java Control Structures
Overview: Java Control Structures
If/Else
Switch/Case/Default
While and Do/While
For Loops
Break and Continue
Labeled Loops
Logical "And" (&&) and "Or" (||)
Java Arrays
Array Elements and Initialization
Arrays are Objects
Object Groups and Polymorphism
Command Line Arguments
Garbage Collection
Review: Java Control Structures
Lab: Java Control Structures
Java Classes
Features of a Java Class
Inheritance of Classes
The "Object" Class
Class vs. Object Hierarchies
Java Modifiers
Access Modifiers
General Modifiers
Specialized Modifiers
The "final" Modifier
Abstract Classes and Methods
Inheriting from Abstract Classes
Java Interfaces
Inheriting from Interfaces
Multiple Inheritance
Interfaces and Polymorphism
Abstract Classes vs. Interfaces
Inner Classes
Instantiating Inner Classes
Anonymous Inner Classes
Review: Java Classes
Lab: Java Classes
Java GUI Components
Java Packages and "import"
Abbreviated API Documentation
Classes in the Abbreviated API
Differences from the Normal API
AWT vs. Swing
java.awt Hierarchy
javax.swing Hierarchy
Components and Containers
Basic Components
Creating Components
Working with Components
Scrollbars
Frames and JFrames
Adding Components to Frame
Displaying and Hiding Frames
GUI Application Templates
Review: Java GUI Components
Lab: Java GUI Components
Containers and Layouts
AWT and Swing Containers
Panels and ScrollPanes
Top-Level Containers
Dialogs Belong to Other Windows
The JOptionPane Dialogs
Layout: Positioning Components
Flow Layout
Grid Layout
BorderLayout
Border Layout Example
Nested Layouts
Nested Layout Example
Review: Containers and Layouts
Lab: Containers and Layouts
Nested Containers for Lab
Java Event Handling
Java Event Model
java.awt.event Events
java.awt.event Listeners
Working with Events
Listener Definition
Listener Registration
Listener Registration and Events
Example of Event Handling
Component Listeners and Events
Other Listeners and Events
Listeners with Many Handlers
Adapter Classes
Event Handler Templates
Review: Java Event Handling
Lab: Java Event Handling
Object-Oriented Topics
Overview: Object-Oriented Topics
Defining Constructors
Default No-Parameter Constructor
this() to Call Other Constructors
super() to Call Super Constructors
Implicit Call to super() Constructor
Order of Class Construction
Defining New Java Packages
Compiling Classes into Packages
Package Use in Other Classes
Finding Classes on the Classpath
Batch Files to Manage Commands
Access Modifiers
Javadoc Documentation Generation
Javadoc Markup Syntax
Using the Javadoc Utility
Review: Object-Oriented Topics
Lab: Object-Oriented Topics
The java.lang Package
java.lang Hierarchy
The Object Class
Object methods
Example of Object Equality Test
Cloneable Interface
Shallow vs. Deep Clones
Comparable Interface
Strings: a Special Class
Assignments & String Immutability
String Methods
StringBuffer
Primitive Wrappers
Math Methods
System
Class
Review: The java.lang Package
Lab: The java.lang Package
Java Exceptions
Overview: Java Exceptions
Exception Hierarchy
Types of Java Errors
Methods of Throwable
Exception Generation
Handling Exceptions: try/catch
Handling Multiple Exceptions
Handling Exceptions: finally
Exceptions in finally Block
Pass Exception to Higher Method
Exceptions and Inheritance
Re-Throwing Exceptions
Re-Typing Exceptions
Runtime (Unchecked) Exceptions
Checked vs. Unchecked Exceptions
Processing in the Catch Block
Defining New Kinds of Exceptions
Design by Contract and Exceptions
Review: Java Exceptions
Lab: Java Exceptions
The java.util Package
java.util Hierarchy
Date
Calendar
java.text.DateFormat
Vector
Enumeration
Hashtable
Collections Hold Generic Objects
Arrays
StringTokenizer
Properties
Loading Properties
Example: SomeClass Properties
Review: The java.util Package
Lab: java.util Package
Lab: Sales Person Flow
Java Input/Output
Java Input/Output through Streams
java.io Byte Streams
java.io Character Streams
Stream Chaining
Multiple Stream Chaining
Common Stream Methods
Stream Exception Handling
File Input Example
File Output Example
System Streams
File Class
Platform-Neutral File Access
FileDialog and JFileChooser
Review: Java Input/Output
Lab: Java Input/Output
Object Serialization and JavaBeans
Serializing Objects
Serializable Interface
Marking Properties as Transient
Serializable Class Prerequisites
Serialized Object Trees
Object Output Stream
Object Input Stream
Software Components
Software Component Models
JavaBean Components
An Example JavaBean
Visual Programming
Review: Object Serialization
Lab: Object Serialization 320
Java Threads
Multi-Tasking Operation Systems
Common Uses for Multi-Threading
Java Threads
Thread Contention
Static Thread Methods
Thread Methods
Blocking Conditions and Threads
Thread Lifecycle
Interrupting Threads
Interrupting Sleeps and Waits
Thread Priorities and Daemons
Runnable Interface
Using Runnable with a Thread
Example: A Runnable Clock Label
Worker Threads
Worker Threads with Parameters
Worker Threads and Return Values
Worker Threads as Inner Classes
Review: Java Threads
Lab: Java Threads
Thread Synchronization
Data Corruption by Racing Threads
Corruption Example
Thread-Safe Methods
Corruption Example Revisited
The Object Monitor
Synchronized vs. Unsynchronized
Synchronization Issues
Waiting for Objects to be Valid
wait() and notifyAll()
Object Validity Checks: if vs. while
Interruptions While Waiting
Wait Example: Channels and Users
Wait Example: Channel Manager
Thread Deadlock
Deadlock Example
Deprecated Thread Methods
Thread Design Issues
Review: Thread Synchronization
Lab: Thread Synchronization
Lab: Id Generator Structure
Java Collections
Collection Hierarchy
Interfaces vs. Concrete Collections
Basic Collection Interfaces
Collections Hold Generic Objects
Collection
Iterator
List
Concrete Lists
Sets
Map
Map Subclasses
Iterating Through Maps
Collections Utility Class
Collections and Threads
Collection Exceptions
Review: Java Collections
Lab: Java Collections
JDK 1.5 Syntax
Overview: JDK 1.5 Enhancements
Generic Types
Generics Are Shared
Generics And Inheritance
Wildcards For Generic Types
Other Collection Enhancements
Enhanced for Loop
Autoboxing / Unboxing
Enumerated Types In Java
Java 1.5 Type-safe Enums
Variable Arguments
Variable Arguments In JDK 1.5
Static Import
Annotations
Review: JDK 1.5 Enhancements
Lab: JDK 1.5 Enhancements
Appendix 1: Java Graphics
Overview: Java Graphics
Java Graphics
Fonts
Colors
Setting Component Font and Color
Drawing by the paint() Method
Drawing Methods of Graphics
Graphics and Screen Refresh
Double Buffering
Custom Graphics Techniques
Template for a Drawing Panel
Dynamic Graphics Updates
Images and Icons
Review: Java Graphics
Lab: Java Graphics
Graphics Lab Application Flow
Appendix 2: Java Applets
Overview: Java Applets
java.applet Hierarchy
Java Applets
Applet Templates
Applet Life-Cycle
Example Applet
Embedding Applets in Web Pages
Other APPLET Tag Attributes
Passing Parameters to Applets
Custom Classes Used by Applets
Applet Security Restrictions
Converting Applications to Applets
Converting Applets to Applications
Example Conversion
Using the Sun Browser Plug-in
Review: Java Applets
Lab: Java Applets
Appendix 3: Random Access Files
Random Access Files
Creating Random Access Files
Read and Write Methods
Methods for Random Access
Fixed Data Record Size
Reading Fixed Records