Book description
The Deitels' groundbreaking How to Program series offers unparalleled breadth and depth of object-oriented programming concepts and intermediate-level topics for further study. This survey of Java programming contains an extensive OOD/UML 2 case study on developing an automated teller machine. The Seventh Edition has been extensively fine-tuned and is completely up-to-date with Sun Microsystems, Inc.’s latest Java release–Java Standard Edition (Java SE) 6.
Table of contents
- Copyright
- Deitel® Series Page
- Preface
- Before You Begin
-
Introduction to Computers, the Internet and the Web
- Introduction
- What Is a Computer?
- Computer Organization
- Early Operating Systems
- Personal, Distributed and Client/Server Computing
- The Internet and the World Wide Web
- Machine Languages, Assembly Languages and High-Level Languages
- History of C and C++
- History of Java
- Java Class Libraries
- Fortran, COBOL, Pascal and Ada
- BASIC, Visual Basic, Visual C++, C# and .NET
- Typical Java Development Environment
- Notes about Java and Java How to Program, 7/e
- Test-Driving a Java Application
- Software Engineering Case Study: Introduction to Object Technology and the UML
- Web 2.0
- Software Technologies
- Wrap-Up
- Web Resources
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
-
Introduction to Java Applications
- Introduction
- A First Program in Java: Printing a Line of Text
- Modifying Our First Java Program
- Displaying Text with printf
- Another Java Application: Adding Integers
- Memory Concepts
- Arithmetic
- Decision Making: Equality and Relational Operators
- (Optional) Software Engineering Case Study: Examining the Requirements Document
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
-
Introduction to Classes and Objects
- Introduction
- Classes, Objects, Methods and Instance Variables
- Declaring a Class with a Method and Instantiating an Object of a Class
- Declaring a Method with a Parameter
- Instance Variables, set Methods and get Methods
- Primitive Types vs. Reference Types
- Initializing Objects with Constructors
- Floating-Point Numbers and Type double
- (Optional) GUI and Graphics Case Study: Using Dialog Boxes
- (Optional) Software Engineering Case Study: Identifying the Classes in a Requirements Document
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
-
Control Statements: Part 1
- Introduction
- Algorithms
- Pseudocode
- Control Structures
- if Single-Selection Statement
- if...else Double-Selection Statement
- while Repetition Statement
- Formulating Algorithms: Counter-Controlled Repetition
- Formulating Algorithms: Sentinel-Controlled Repetition
- Formulating Algorithms: Nested Control Statements
- Compound Assignment Operators
- Increment and Decrement Operators
- Primitive Types
- (Optional) GUI and Graphics Case Study: Creating Simple Drawings
- (Optional) Software Engineering Case Study: Identifying Class Attributes
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
-
Control Statements: Part 2
- Introduction
- Essentials of Counter-Controlled Repetition
- for Repetition Statement
- Examples Using the for Statement
- do...while Repetition Statement
- switch Multiple-Selection Statement
- break and continue Statements
- Logical Operators
- Structured Programming Summary
- (Optional) GUI and Graphics Case Study: Drawing Rectangles and Ovals
- (Optional) Software Engineering Case Study: Identifying Objects’ States and Activities
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
-
Methods: A Deeper Look
- Introduction
- Program Modules in Java
- static Methods, static Fields and Class Math
- Declaring Methods with Multiple Parameters
- Notes on Declaring and Using Methods
- Method-Call Stack and Activation Records
- Argument Promotion and Casting
- Java API Packages
- Case Study: Random-Number Generation
- Case Study: A Game of Chance (Introducing Enumerations)
- Scope of Declarations
- Method Overloading
- (Optional) GUI and Graphics Case Study: Colors and Filled Shapes
- (Optional) Software Engineering Case Study: Identifying Class Operations
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
-
Arrays
- Introduction
- Arrays
- Declaring and Creating Arrays
- Examples Using Arrays
- Case Study: Card Shuffling and Dealing Simulation
- Enhanced for Statement
- Passing Arrays to Methods
- Case Study: Class GradeBook Using an Array to Store Grades
- Multidimensional Arrays
- Case Study: Class GradeBook Using a Two-Dimensional Array
- Variable-Length Argument Lists
- Using Command-Line Arguments
- (Optional) GUI and Graphics Case Study: Drawing Arcs
- (Optional) Software Engineering Case Study: Collaboration Among Objects
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
- Special Section: Building Your Own Computer
-
Classes and Objects: A Deeper Look
- Introduction
- Time Class Case Study
- Controlling Access to Members
- Referring to the Current Object’s Members with the this Reference
- Time Class Case Study: Overloaded Constructors
- Default and No-Argument Constructors
- Notes on Set and Get Methods
- Composition
- Enumerations
- Garbage Collection and Method finalize
- static Class Members
- static Import
- final Instance Variables
- Software Reusability
- Data Abstraction and Encapsulation
- Time Class Case Study: Creating Packages
- Package Access
- (Optional) GUI and Graphics Case Study: Using Objects with Graphics
- (Optional) Software Engineering Case Study: Starting to Program the Classes of the ATM System
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercise
- Answers to Self-Review Exercise
- Exercises
-
Object-Oriented Programming: Inheritance
- Introduction
- Superclasses and Subclasses
- protected Members
- Relationship between Superclasses and Subclasses
- Constructors in Subclasses
- Software Engineering with Inheritance
- Object Class
- (Optional) GUI and Graphics Case Study: Displaying Text and Images Using Labels
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
-
Object-Oriented Programming: Polymorphism
- Introduction
- Polymorphism Examples
- Demonstrating Polymorphic Behavior
- Abstract Classes and Methods
- Case Study: Payroll System Using Polymorphism
- final Methods and Classes
- Case Study: Creating and Using Interfaces
- (Optional) GUI and Graphics Case Study: Drawing with Polymorphism
- (Optional) Software Engineering Case Study: Incorporating Inheritance into the ATM System
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
-
GUI Components: Part 1
- Introduction
- Simple GUI-Based Input/Output with JOptionPane
- Overview of Swing Components
- Displaying Text and Images in a Window
- Text Fields and an Introduction to Event Handling with Nested Classes
- Common GUI Event Types and Listener Interfaces
- How Event Handling Works
- JButton
- Buttons That Maintain State
- JComboBox and Using an Anonymous Inner Class for Event Handling
- JList
- Multiple-Selection Lists
- Mouse Event Handling
- Adapter Classes
- JPanel Subclass for Drawing with the Mouse
- Key-Event Handling
- Layout Managers
- Using Panels to Manage More Complex Layouts
- JTextArea
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
- Graphics and Java 2D™
-
Exception Handling
- Introduction
- Exception-Handling Overview
- Example: Divide by Zero without Exception Handling
- Example: Handling ArithmeticExceptions and InputMismatchExceptions
- When to Use Exception Handling
- Java Exception Hierarchy
- finally Block
- Stack Unwinding
- printStackTrace, getStackTrace and getMessage
- Chained Exceptions
- Declaring New Exception Types
- Preconditions and Postconditions
- Assertions
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
- Files and Streams
-
Recursion
- Introduction
- Recursion Concepts
- Example Using Recursion: Factorials
- Example Using Recursion: Fibonacci Series
- Recursion and the Method-Call Stack
- Recursion vs. Iteration
- Towers of Hanoi
- Fractals
- Recursive Backtracking
- Wrap-Up
- Internet and Web Resources
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
- Searching and Sorting
- Data Structures
-
Generics
- Introduction
- Motivation for Generic Methods
- Generic Methods: Implementation and Compile-Time Translation
- Additional Compile-Time Translation Issues: Methods That Use a Type Parameter as the Return Type
- Overloading Generic Methods
- Generic Classes
- Raw Types
- Wildcards in Methods That Accept Type Parameters
- Generics and Inheritance: Notes
- Wrap-Up
- Internet and Web Resources
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
-
Collections
- Introduction
- Collections Overview
- Class Arrays
- Interface Collection and Class Collections
- Lists
- Collections Algorithms
- Stack Class of Package java.util
- Class PriorityQueue and Interface Queue
- Sets
- Maps
- Properties Class
- Synchronized Collections
- Unmodifiable Collections
- Abstract Implementations
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
-
Introduction to Java Applets
- Introduction
- Sample Applets Provided with the JDK
- Simple Java Applet: Drawing a String
- Applet Life-Cycle Methods
- Initializing an Instance Variable with Method init
- Sandbox Security Model
- Internet and Web Resources
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercise
- Answers to Self-Review Exercise
- Exercises
-
Multimedia: Applets and Applications
- Introduction
- Loading, Displaying and Scaling Images
- Animating a Series of Images
- Image Maps
- Loading and Playing Audio Clips
- Playing Video and Other Media with Java Media Framework
- Wrap-Up
- Web Resources
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
- Special Section: Challenging Multimedia Projects
- GUI Components: Part 2
-
Multithreading
- Introduction
- Thread States: Life Cycle of a Thread
- Thread Priorities and Thread Scheduling
- Creating and Executing Threads
- Thread Synchronization
- Producer/Consumer Relationship without Synchronization
- Producer/Consumer Relationship: ArrayBlockingQueue
- Producer/Consumer Relationship with Synchronization
- Producer/Consumer Relationship: Bounded Buffers
- Producer/Consumer Relationship: The Lock and Condition Interfaces
- Multithreading with GUI
- Other Classes and Interfaces in java.util.concurrent
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
-
Networking
- Introduction
- Manipulating URLs
- Reading a File on a Web Server
- Establishing a Simple Server Using Stream Sockets
- Establishing a Simple Client Using Stream Sockets
- Client/Server Interaction with Stream Socket Connections
- Connectionless Client/Server Interaction with Datagrams
- Client/Server Tic-Tac-Toe Using a Multithreaded Server
- Security and the Network
- [Web Bonus] Case Study: DeitelMessenger Server and Client
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
-
Accessing Databases with JDBC
- Introduction
- Relational Databases
- Relational Database Overview: The books Database
- SQL
- Instructions for installing MySQL and MySQL Connector/J
- Instructions for Setting Up a MySQL User Account
- Creating Database books in MySQL
- Manipulating Databases with JDBC
- RowSet Interface
- Java DB/Apache Derby
- PreparedStatements
- Stored Procedures
- Transaction Processing
- Wrap-Up
- Web Resources and Recommended Readings
- Summary
- Terminology
- Self-Review Exercise
- Answers to Self-Review Exercise
- Exercises
-
Web Applications: Part 1
- Introduction
- Simple HTTP Transactions
- Multitier Application Architecture
- Java Web Technologies
- Creating and Running a Simple Application in Java Studio Creator 2
- JSF Components
- Session Tracking
- Wrap-Up
- Web Resources
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
- Web Applications: Part 2
-
JAX-WS Web Services, Web 2.0 and Mash-Ups
- Introduction
- Java Web Services Basics
- Creating, Publishing, Testing and Describing a Web Service
- Consuming a Web Service
- SOAP
- Session Tracking in Web Services
- Consuming a Database-Driven Web Service from a Web Application
- Passing an Object of a User-Defined Type to a Web Service
- Wrap-Up
- Web Resources
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
-
Formatted Output
- Introduction
- Streams
- Formatting Output with printf
- Printing Integers
- Printing Floating-Point Numbers
- Printing Strings and Characters
- Printing Dates and Times
- Other Conversion Characters
- Printing with Field Widths and Precisions
- Using Flags in the printf Format String
- Printing with Argument Indices
- Printing Literals and Escape Sequences
- Formatting Output with Class Formatter
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
-
Strings, Characters and Regular Expressions
- Introduction
- Fundamentals of Characters and Strings
- Class String
- Class StringBuilder
- Class Character
- Class StringTokenizer
- Regular Expressions, Class Pattern and Class Matcher
- Wrap-Up
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
- Special Section: Advanced String-Manipulation Exercises
- Special Section: Challenging String-Manipulation Projects
- Operator Precedence Chart
- ASCII Character Set
- Keywords and Reserved Words
- Primitive Types
-
Number Systems
- Introduction
- Abbreviating Binary Numbers as Octal and Hexadecimal Numbers
- Converting Octal and Hexadecimal Numbers to Binary Numbers
- Converting from Binary, Octal or Hexadecimal to Decimal
- Converting from Decimal to Binary, Octal or Hexadecimal
- Negative Binary Numbers: Two’s Complement Notation
- Summary
- Terminology
- Self-Review Exercises
- Answers to Self-Review Exercises
- Exercises
- GroupLayout
- Java Desktop Integration Components (JDIC)
-
Mashups
- Introduction
- Popular Mashups
- APIs Commonly Used in Mashups
- Deitel Mashups Research Center
- Deitel RSS Resource Center
- Mashup Performance and Reliability Issues
- Mashup Tutorials
- Mashup Directories
- Mashup Resources
- Mashup Tools and Downloads
- Mashup Articles
- Mashups in the Blogosphere
- Mashup FAQs and Newsgroups
- Unicode®
- Using the Java API Documentation
- Creating Documentation with javadoc
- Bit Manipulation
- ATM Case Study Code
- Labeled break and continue Statements
- UML 2:Additional Diagram Types
- Design Patterns
- Using the Debugger
- Index
Product information
- Title: Java™ How to Program, Seventh Edition
- Author(s):
- Release date: December 2006
- Publisher(s): Pearson
- ISBN: 9780136085676
You might also like
book
Software for Use: A Practical Guide to the Models and Methods of Usage-Centered Design
In the quest for quality, software developers have long focused on improving the internal architecture of …
book
Java™ for Programmers: Deitel
PRACTICAL, EXAMPLE-RICH COVERAGE OF: Classes, Objects, Encapsulation, Inheritance, Polymorphism, Interfaces, Nested Classes Integrated OOP Case Studies: …
book
How to Use Objects: Code and Concepts
While most developers today use object-oriented languages, the full power of objects is available only to …
book
Object-oriented Programming Using C++ and Java
This book offers contemporary, comprehensive and in-depth coverage of all the concepts of object-oriented technologies, with …