Tải bản đầy đủ (.pdf) (4,302 trang)

Java, Java, Java™: ObjectOriented Problem Solving, Third Edition ppt

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (14.87 MB, 4,302 trang )

Java, Java, Java™: Object-
Oriented Problem Solving,
Third Edition
Table of Contents
Copyright
Preface
What's New in the Third
Edition?
Why Start with Objects?
Organization of the Text
Chapter 0. Computers, Objects,
and Java
Section 0.1. Welcome
Section 0.2. What Is a
Computer?
Section 0.3. Networks, the
Internet, and the World Wide
Web
Section 0.4. Why Study
Programming?
Section 0.5. Programming
Languages
Section 0.6. Why Java?
Section 0.7. What Is Object-
Oriented Programming?
Chapter Summary
Exercises
Chapter 1. Java Program
Design and Development
Section 1.1. Introduction


Section 1.2. Designing Good
Programs
Section 1.3. Designing a Riddle
Program
Section 1.4. Java Language
Elements
Section 1.5. Editing, Compiling,
and Running a Java Program
Section 1.6. From the Java
Library: System and
PrintStream
Chapter Summary
Solutions to Self-Study
Exercises
Exercises
Chapter 2. Objects: Using,
Creating, and Defining
Section 2.1. Introduction
Section 2.2. Using String
Objects
Section 2.3. Drawing Shapes
with a Graphics Object
(Optional)
Section 2.4. Class Definition
Section 2.5. Case Study:
Simulating a Two-Person Game
Section 2.6. From the Java
Library: java.util.Scanner
Chapter Summary
Solutions to Self-Study

Exercises
Exercises
Chapter 3. Methods:
Communicating with Objects
Section 3.1. Introduction
Section 3.2. Passing
Information to an Object
Section 3.3. Constructor
Methods
Section 3.4. Retrieving
Information from an Object
Section 3.5. Passing a Value
and Passing a Reference
Section 3.6. Flow of Control:
Control Structures
Section 3.7. Testing an
Improved OneRowNim
Section 3.8. From the Java
Library: java.lang.Object
Section 3.9. Object-Oriented
Design: Inheritance and
Polymorphism
Section 3.10. Drawing Lines
and Defining Graphical
Methods (Optional)
Chapter Summary
Solutions to Self-Study
Exercises
Exercises
Chapter 4. Input/Output:

Designing the User Interface
Section 4.1. Introduction
Section 4.2. The User Interface
Section 4.3. A Command-Line
Interface
Section 4.4. A Graphical User
Interface (GUI)
Section 4.5. Case Study: The
One-Row Nim Game
Section 4.6. From the Java
Library: java.io.File and File
Input (Optional)
Chapter Summary
Solutions to Self-Study
Exercises
Exercises
Chapter 5. Java Data and
Operators
Section 5.1. Introduction
Section 5.2. Boolean Data and
Operators
Section 5.3. Numeric Data and
Operators
Section 5.4. From the Java
Library: java.lang.Math
Section 5.5. Numeric
Processing Examples
Section 5.6. From the Java
Library:
java.text.NumberFormat

Section 5.7. Character Data and
Operators
Section 5.8. Example:
Character Conversions
Section 5.9. Problem Solving =
Representation + Action
Chapter Summary
Solutions to Self-Study
Exercises
Exercises
Chapter 6. Control Structures
Section 6.1. Introduction
Section 6.2. Flow of Control:
Repetition Structures
Section 6.3. Counting Loops
Section 6.4. Example: Car Loan
Section 6.5. Graphics Example:
Drawing a Checkerboard
Section 6.6. Conditional Loops
Section 6.7. Example:
Computing Averages
Section 6.8. Example: Data
Validation
Section 6.9. Principles of Loop
Design
Section 6.10. The switch
Multiway Selection Structure
Section 6.11. Object-Oriented
Design: Structured
Programming

Chapter Summary
Solutions to Self-Study
Exercises
Exercises
Chapter 7. Strings and String
Processing
Section 7.1. Introduction
Section 7.2. String Basics
Section 7.3. Finding Things
within a String
Section 7.4. Example: Keyword
Search
Section 7.5. From the Java
Library: java.lang.StringBuffer
Section 7.6. Retrieving Parts of
Strings
Section 7.7. Example:
Processing Names and
Passwords
Section 7.8. Processing Each
Character in a String
Section 7.9. Comparing Strings
Section 7.10. From the Java
Library:
java.util.StringTokenizer
Section 7.11. Handling Text in
a Graphics Context (Optional)
Chapter Summary
Solutions to Self-Study
Exercises

Exercises
Chapter 8. Inheritance and
Polymorphism
Section 8.1. Introduction
Section 8.2. Java's Inheritance
Mechanism
Section 8.3. Abstract Classes,
Interfaces, and Polymorphism
Section 8.4. Example: A Toggle
Button
Section 8.5. Example: The
Cipher Class Hierarchy
Section 8.6. Case Study: A
Two-Player Game Hierarchy
Section 8.7. Principles of
Object-Oriented Design
Chapter Summary
Solutions to Self-Study
Exercises
Exercises
Chapter 9. Arrays and Array
Processing
Section 9.1. Introduction
Section 9.2. One-Dimensional
Arrays
Section 9.3. Simple Array
Examples
Section 9.4. Example: Counting
Frequencies of Letters
Section 9.5. Array Algorithms:

Sorting
Section 9.6. Array Algorithms:
Searching
Section 9.7. Two-Dimensional
Arrays
Section 9.8. Multidimensional
Arrays (Optional)
Section 9.9. Object-Oriented
Design: Polymorphic Sorting
(Optional)
Section 9.10. From the Java
Library: java.lang.Vector
Section 9.11. CASE STUDY:
An N-Player Computer Game
Section 9.12. A GUI-Based
Game (Optional Graphics)
Chapter Summary
Solutions to Self-Study
Exercises
Exercises
Chapter 10. Exceptions: When
Things Go Wrong
Section 10.1. Introduction
Section 10.2. Handling
Exceptional Conditions
Section 10.3. Java's Exception
Hierarchy
Section 10.4. Handling
Exceptions within a Program
Section 10.5. Error Handling

and Robust Program Design
Section 10.6. Creating and
Throwing Your Own
Exceptions
Section 10.7. From the Java
Library:
javax.swing.JOptionPane
Chapter Summary
Solutions to Self-Study
Exercises
Exercises
Chapter 11. Files and Streams:
Input/Output Techniques
Section 11.1. Introduction
Section 11.2. Streams and Files
Section 11.3. Case Study:
Reading and Writing Text Files
Section 11.4. The File Class
Section 11.5. Example: Reading
and Writing Binary Files
Section 11.6. Object
Serialization: Reading and
Writing Objects
Section 11.7. From the Java
Library:
javax.swing.JFileChooser
Section 11.8. Using File Data in
Programs
Chapter Summary
Solutions to Self-Study

Exercises
Exercises
Chapter 12. Recursive Problem
Solving
Section 12.1. Introduction
Section 12.2. Recursive
Definition
Section 12.3. Recursive String
Methods
Section 12.4. Recursive Array
Processing
Section 12.5. Example:
Drawing (Recursive) Fractals
Section 12.6. Object-Oriented
Design: Tail Recursion
Section 12.7. Object-Oriented
Design: Recursion or Iteration?
Section 12.8. From the Java
Library:
javax.swing.JComboBox
Chapter Summary
Solutions to Self-Study
Exercises
Exercises
Chapter 13. Graphical User
Interfaces
Section 13.1. Introduction
Section 13.2. Java GUIs: From
AWT to Swing
Section 13.3. The Swing

Component Set
Section 13.4. Object-Oriented
Design: Model-View-Controller
Architecture
Section 13.5. The Java Event
Model
Section 13.6. Case Study:
Designing a Basic GUI
Section 13.7. Containers and
Layout Managers
Section 13.8. Checkboxes,
Radio Buttons, and Borders
Section 13.9. Menus and Scroll
Panes
Chapter Summary
Solutions to Self-Study
Exercises
Exercises
Chapter 14. Threads and
Concurrent Programming
Section 14.1. Introduction
Section 14.2. What Is a
Thread?
Section 14.3. From the Java
Library: java.lang.Thread
Section 14.4. Thread States and
Life Cycle
Section 14.5. Using Threads to
Improve Interface
Responsiveness

Section 14.6. Case Study:
Cooperating Threads
Section 14.7. Case Study: The
Game of Pong
Chapter Summary

×