Preface | p. xiii |
New Features in the Second Edition | p. xiv |
Major Features | p. xv |
Supplement Materials | p. xxiv |
Book Organization | p. xxv |
Acknowledgments | p. xxvii |
Introduction to Computers and Programming Languages | p. 1 |
A History of Computers | p. 2 |
Computer Architecture | p. 5 |
Programming Languages | p. 11 |
Java | p. 13 |
Exercises | p. 14 |
Introduction to Object-Oriented Programming and Software Development | p. 15 |
Classes and Objects | p. 16 |
Messages and Methods | p. 18 |
Class and Instance Data Values | p. 23 |
Inheritance | p. 26 |
Software Engineering and Software Life Cycle | p. 29 |
Having Fun with Java | p. 31 |
Exercises | p. 34 |
Java Programming Basics | p. 37 |
The First Java Application | p. 38 |
Program Components | p. 48 |
Edit--Compile--Run Cycle | p. 59 |
The javabook Package | p. 61 |
Sample Program: Displaying Messages | p. 62 |
The First Java Applet | p. 66 |
Exercises | p. 77 |
Numerical Data | p. 83 |
Variables | p. 84 |
Arithmetic Expressions | p. 92 |
Constants | p. 98 |
The Math Class | p. 100 |
InputBox | p. 103 |
OutputBox | p. 106 |
Sample Program: Loan Calculator | p. 113 |
Numerical Representation (Optional) | p. 124 |
Exercises | p. 128 |
Defining Instantiable Classes | p. 139 |
Defining Instantiable Classes | p. 140 |
Instantiable Classes and Constructors | p. 152 |
Visibility Modifiers: public and private | p. 157 |
Local Variables, Return Values, and Parameter Passing | p. 162 |
Loan Calculator Program with an Instantiable Class | p. 167 |
Exercises | p. 181 |
Processing Input with Applets | p. 191 |
Placing GUI Objects on Applets | p. 192 |
Adding ActionListener to an Event Source | p. 199 |
Absolute Positioning of GUI Objects | p. 206 |
The Button Class | p. 208 |
Converting Text to a Numerical Value | p. 210 |
Sample Program: Finding Body Mass Index (BMI) | p. 213 |
Running an Applet as an Application | p. 223 |
Exercises | p. 224 |
Selection Statements | p. 229 |
The if Statement | p. 230 |
Boolean Expressions and Variables | p. 238 |
Nested-if Statements | p. 242 |
ListBox | p. 249 |
The switch Statement | p. 252 |
Sample Program: Drawing Shapes | p. 258 |
Exercises | p. 280 |
Repetition Statements | p. 289 |
The while Statement | p. 290 |
Pitfalls in Writing Repetition Statements | p. 294 |
The do--while Statement | p. 299 |
ResponseBox | p. 303 |
The for Statement | p. 308 |
Nested-for Statements | p. 312 |
The Format Class | p. 316 |
Loan Tables | p. 322 |
Sample Program: Hi-Lo Game | p. 325 |
Recursive Methods (Optional) | p. 338 |
Exercises | p. 343 |
Characters and Strings | p. 355 |
Characters | p. 356 |
Strings | p. 359 |
Primitive versus Reference Types | p. 370 |
StringBuffer | p. 379 |
Passing Objects as Parameters | p. 384 |
Returning an Object from Methods | p. 389 |
Sample Program: Word Play | p. 392 |
Exercises | p. 404 |
Arrays | p. 411 |
Array Basics | p. 412 |
Arrays of Objects | p. 421 |
Passing Arrays to Methods | p. 431 |
MultilnputBox | p. 436 |
Self-Referencing Pointer | p. 439 |
Sample Development: The Address Book | p. 446 |
Two-Dimensional Arrays | p. 463 |
Vectors | p. 470 |
Exercises | p. 476 |
Sorting and Searching | p. 481 |
Searching | p. 482 |
Sorting | p. 488 |
Heapsort | p. 495 |
Sample Program: Sorting an AddressBook | p. 509 |
Exercises | p. 515 |
File Input and Output | p. 519 |
File and FileDialog Objects | p. 520 |
Low-Level File I/O | p. 525 |
High-Level File I/O | p. 532 |
Handling Exceptions | p. 539 |
Object I/O | p. 544 |
Sample Class: Saving an AddressBook Object | p. 548 |
Exercises | p. 556 |
Reusable Classes and Packages | p. 559 |
Object Categories | p. 560 |
Method Overriding and Overloaded Methods | p. 562 |
Sample Classes: Reusable EggyPeggy and HiLo | p. 569 |
Package Organization | p. 595 |
Exercises | p. 597 |
GUI Objects and Event-Driven Programming | p. 603 |
Placing Buttons on a Frame | p. 605 |
Handling Events | p. 611 |
Placing TextField Objects on a Frame | p. 618 |
Menus | p. 620 |
Handling Mouse Events | p. 626 |
Other GUI Objects | p. 634 |
Sample Program: A Simple Calculator | p. 639 |
Exercises | p. 652 |
Inheritance and Polymorphism | p. 657 |
Defining Classes with Inheritance | p. 658 |
Using Classes Effectively with Polymorphism | p. 662 |
Inheritance and Member Accessibility | p. 666 |
Inheritance and Constructors | p. 672 |
Abstract Superclasses and Abstract Methods | p. 676 |
When and When Not to Use Inheritance | p. 682 |
Sample Program: Computing Course Grades | p. 684 |
Exercises | p. 704 |
Class Roster Maintenance Program | p. 709 |
Method Call Sequence Diagram | p. 710 |
Problem Statement | p. 711 |
Overall Planning | p. 712 |
Step 1 Development: Program Shell with Menus | p. 716 |
Step 2 Development: Create a New Roster | p. 722 |
Step 3 Development: Add Students | p. 729 |
Step 4 Development: Delete Students | p. 737 |
Step 5 Development: Edit Student Names | p. 740 |
Step 6 Development: Edit Test Scores and Compute Grades | p. 746 |
Step 7 Development: Display Student Information | p. 753 |
Step 8 Development: Storing Grade Rosters | p. 765 |
Step 9 Development: Finalize and Improve | p. 775 |
The StudentNameDialog Class | p. 776 |
The TestScoreDialog Class | p. 786 |
Exercises | p. 791 |
Recursive Algorithms | p. 797 |
Basic Elements of Recursion | p. 798 |
Directory Listing | p. 799 |
Anagram | p. 801 |
Towers of Hanoi | p. 805 |
Quicksort | p. 809 |
When Not to Use Recursion | p. 815 |
Exercises | p. 817 |
The javabook Package | p. 819 |
Table of Contents provided by Syndetics. All Rights Reserved. |