1. Introduction. Recipes.
Algorithms - Being Precise.
Implementing our Algorithm in Java.
Why Java?
Network Computing and the Web.
Human-Computer Interaction and the GUI.
2. Program Fundamentals. Hello, world! in Java.
Compiling and Running Your Java Program.
Lexical Elements.
Precedence and Associativity of Operators.
Data Types and Variable Declarations.
An Example: String Concatenation.
Input from the User.
Calling Predefined Methods.
Some More on print() and println().
Number Types.
Arithmetic Expressions.
Assignment Operators.
The Increment and Decrement Operators.
Precedence and Associativity of Operators.
Programming Style.
3. Statements and Control Flow. Expression, Block, and Empty Statements.
Boolean Expressions.
The if and the if-else Statements.
Problem Solving with the if Statement.
The if-else Statements.
The while Statement.
The for Statement.
The break and continue Statements.
The switch Statement.
Using the Laws of Boolean Algebra.
Programming Style.
4. Methods: Functional Abstraction. Method Invocation.
Static Method Definitions.
The Return Statement.
Top-Down Design.
Problem Solving: Random Numbers.
A Simulation: Probability Calculations.
Invocation and Call-by-Value. AHEADS = Scope of Variables.
Problem Solving: A Computer Game.
Recursion.
Problem Solving: Mathematical Functions.
Method Overloading.
Programming Style.
5. Arrays. One-Dimensional Arrays.
Passing Arrays to Methods.
Array Assignment.
A Simple Sorting Method.
Searching an Ordered Array.
Big-Oh: Choosing the Best Algorithm.
Two-Dimensional Arrays.
An Elementary Simulation: The Game of Life.
Arrays of Non-Primitive Types.
Programming Style.
6. Objects: Data Abstraction. Creating and Manipulating Objects.
Problem Solving: Rectangles.
The Elements of a Simple Class.
Access public and private: Data Hiding.
Constructor Methods and Object Creation.
Static Fields and Methods.
Calling Methodsna Recap.
Problem Solving: Roots of a Quadratic.
Accessing Another Object's Private Fields.
Passing Objects and Call-By-Reference.
The this Reference.
Keyword, Final, and Class Constants.
Object-Oriented Design.
Programming Style.
7. Inheritance. A Student is a Person.
Overriding Instance Methods.
The Access Modifiers private and public Revisited.
The Access Modifier Protected.
Type Object and Inheritance.
Inheritance and Design.
The Instance of Operator and Casting Non-Primitive Types.
Programming Style.
8. Graphic User Interfaces: Part I. Hello world! Button.
Listening to Events.
Text and Numerical Input.
Using Several Components.
Drawing with Swing.
FlowLayout.
A Simple Drawing Program.
Applets.
Programming Style.
9. Graphical User Interfaces: Part II. Arranging Components in a GUI.
Getting a Component to Resize.
Problem Solving: Plotting Data.
The Graphics Class.
Changing the Stroke Used in Drawing.
Adding Menus to Your GUI.
Event Listeners and Adapters.
Programming Style.
10. Reading and Writing Files. Types of Files.
Writing Text Files.
Reading Text Files.
Formatting Text Output.
Using Command Line Argument.
Problem Solving: Encrypting Text Files.
Reading and Writing Binary Files.
Detecting the End of an Input Stream.
Programming Style.
11. Exceptions. Exception Handling with try and catch.
Program Correctness: Throwing an Exception.
RuntimeExceptions and the throws Clause.
12. Dynamic Data Structures. Self-Referential Structures.
A Linked List Implementation of a Stack.
A Singly Linked List.
More Operations on Lists.
A Generic Stack.
An Example: Polish Notation and Stack Evaluation.
Queues.
Iterators.
Iterators and the Interface Enumeration.
Deleting Objects.
Packages.
Programming Style.
13. Concurrent Programming with Java Threads. Implicit Threads from AWT.
Creating Threads.
Communicating Between Two Threads.
Synchronizing Two Threads.
Passing Messages to Another Computer.
A Multi-Threaded Server.
More About the sleep(), wait(), and notify().
Programming Style.
Appendix A. Getting Down to the Bits. Integer Binary Representation.
Floating Point Representations.
Manipulating Bits.
Appendix B. Reference Tables. Operator Precedence Table.
The Standard Java Math Functions.
Appendix C. The Text I/O Package tio. The Class tio.Readinput.
The Class tio.FormattedWriter.
The Class tio.ReadException.
The Class tio.Console.
The Class tio.PrintFileWriter
Appendix D. Syntax Charts. Fundamentals.
Declaring Variables.
Declaring Methods.
Expressions.
Statements.
Classes.
Appendix E. AWT Summary. The Class JPanel.
The Class JScrollPane.
Index.