內容簡介
本書是采組關於Java語言的權威教材,秉承Deitel系列叢書的一貫特點:內容豐富、覆蓋面廣,提供詳細贈協盛代碼與實例研究,總結出大量的面向對象編程技巧和經驗。本書詳細說明甩廈地戶了在Java中面向對象編程的基本理論及實用知識,以初學者為滲記踏起點,由點到面、由淺入深、循序漸進地介頁慨設紹了事件處理、臭章射符對象、接口、內置類、繼承、多態性、數據結構盛棕埋和集合、流檔案、applet、圖形界面及多執行緒等多種Java特性。第八版在前一版的基礎上增加了更多的實際案例,更新了很多內容,有助於讀者學習和借鑑。本書包括更廣泛的教學特性,其中列舉了數百個可實際使用的程式實例,並給出其實際的運行結果,可以使學生在學習時更為直觀。
圖書目錄
Chapter 1 Introduction to Computers,the Internet and the Web
1.1Introduction
1.2Computers: Hardware and Software
1.3Computer Organization
1.4Early Operating Systems
1.5Personal,Distributed and Client/Server Computing
1.6The Internet and the World Wide Web
1.7Machine Languages,Assembly Languages and HighLevel Languages
1.8History of C and C++
1.9History of Java
1.10Java Class Libraries
1.11Fortran,COBOL,Pascal and Ada
1.12BASIC,Visual Basic,Visual C++,C# and .NET
1.13Typical Java Development Environment
1.14Notes about Java and Java How to Program,Eighth Edition
1.15TestDriving a Java Application
1.16Software Engineering Case Study: Introduction to Object Technology and the UML
1.17Web 2.0
1.18Software Technologies
1.19WrapUp
1.20Web Resources
Chapter 2 Introduction to Java Applications
2.1Introduction
2.2Our First Program in Java: Printing a Line of Text
2.3Modifying Our First Java Program
2.4Displaying Text with printf
2.5Another Application: Adding Integers
2.6Memory Concepts
2.7Arithmetic
2.8Decision Making: Equality and Relational Operators
2.9WrapUp
Chapter 3 Introduction to Classes and Objects
3.1Introduction
3.2Classes,Objects,Methods and Instance Varibles
3.3Declaring a Class with a Method and Instantiating an Object of a Class
3.4Declaring a Method with a Parameter
3.5Instance Variables,set Methods and get Methods
3.6Primitive Types vs. Reference Types
3.7Initializing Objects with Constructors
3.8FloatingPoint Numbers and Type double
3.9(Optional) GUI and Graphics Case Study: Using Dialog Boxes
3.10WrapUp
Chapter 4 Control Statements: Part 1
4.1Introduction
4.2Algorithms
4.3Pseudocode
4.4Control Structures
4.5if SingleSelection Statement
4.6if...else DoubleSelection Statement
4.7while Repetition Statement
4.8Formulating Algorithms: CounterControlled Repetition
4.9Formulating Algorithms: SentinelControlled Repetition
4.10Formulating Algorithms: Nested Control Statements
4.11Compound Assignment Operators
4.12Increment and Decrement Operators
4.13Primitive Types
4.14(Optional) GUI and Graphics Case Study: Creating Simple Drawings
4.15WrapUp
Chapter 5 Control Statements:Part 2
5.1Introduction
5.2Essentials of CounterControlled Repetition
5.3for Repetition Statement
5.4Examples Using the for Statement
5.5do...while Repetition Statement
5.6switch MultipleSelection Statement
5.7break and continue Statements
5.8Logical Operators
5.9Structured Programming Summary
5.10(Optional) GUI and Graphics Case Study: Drawing Rectangles and Ovals
5.11WrapUp
Chapter 6 Methods:A Deeper Look
6.1Introduction
6.2Program Modules in Java
6.3static Methods,static Fields and Class Math
6.4Declaring Methods with Multiple Parameters
6.5Notes on Declaring and Using Methods
6.6MethodCall Stack and Activation Records
6.7Argument Promotion and Casting
6.8Java API Packages
6.9Case Study: RandomNumber Generation
6.10Case Study: A Game of Chance; Introducing Enumerations
6.11Scope of Declarations
6.12Method Overloading
6.13(Optional) GUI and Graphics Case Study: Colors and Filled Shapes
6.14WrapUp
Chapter 7 Arrays and ArrayLists
7.1Introduction
7.2Arrays
7.3Declaring and Creating Arrays
7.4Examples Using Arrays
7.5Case Study: Card Shuffling and Dealing Simulation
7.6Enhanced for Statement
7.7Passing Arrays to Methods
7.8Case Study: Class GradeBook Using an Array to Store Grades
7.9Multidimensional Arrays
7.10Case Study: Class GradeBook Using a TwoDimensional Array
7.11VariableLength Argument Lists
7.12Using CommandLine Arguments
7.13Class Arrays
7.14Introduction to Collections and Class ArrayList
7.15(Optional) GUI and Graphics Case Study: Drawing Arcs
7.16WrapUp
Chapter 8 Classes and Objects: A Deeper Look
8.1Introduction
8.2Time Class Case Study
8.3Controlling Access to Members
8.4Referring to the Current Objects Members with the this Reference
8.5Time Class Case Study: Overloaded Constructors
8.6Default and NoArgument Constructors
8.7Notes on Set and Get Methods
8.8Composition
8.9Enumerations
8.10Garbage Collection and Method finalize
8.11static Class Members
8.12static Import
8.13final Instance Variables
8.14Time Class Case Study: Creating Packages
8.15Package Access
8.16(Optional) GUI and Graphics Case Study: Using Objects with Graphics
8.17WrapUp
Chapter 9 ObjectOriented Programming: Inheritance
9.1Introduction
9.2Superclasses and Subclasses
9.3protected Members
9.4Relationship between Superclasses and Subclasses
9.5Constructors in Subclasses
9.6Software Engineering with Inheritance
9.7Object Class
9.8(Optional) GUI and Graphics Case Study: Displaying Text and Images Using Labels
9.9WrapUp
Chapter 10 ObjectOriented Programming: Polymorphism
10.1Introduction
10.2Polymorphism Examples
10.3Demonstrating Polymorphic Behavior
10.4Abstract Classes and Methods
10.5Case Study: Payroll System Using Polymorphism
10.6final Methods and Classes
10.7Case Study: Creating and Using Interfaces
10.8(Optional) GUI and Graphics Case Study: Drawing with Polymorphism
10.9WrapUpChapter 11Exception Handling
11.1Introduction
11.2ErrorHandling Overview
11.3Example: Divide by Zero without Exception Handling
11.4Example: Handling ArithmeticExceptions and InputMismatchExceptions
11.5When to Use Exception Handling
11.6Java Exception Hierarchy
11.7finally Block
11.8Stack Unwinding
11.9printStackTrace,getStackTrace and getMessage
11.10Chained Exceptions
11.11Declaring New Exception Types
11.12Preconditions and Postconditions
11.13Assertions
11.14WrapUp
Chapter 12 ATM Case Study,Part 1: ObjectOriented Design with the UML
12.1Case Study Introduction
12.2Examining the Requirements Document
12.3Identifying the Classes in a Requirements Document
12.4Identifying Class Attributes
12.5Identifying Objects States and Activities
12.6Identifying Class Operations
12.7Indicating Collaboration Among Objects
12.8WrapUp
Chapter 13 ATM Case Study Part 2: Implementing an ObjectOriented Design
13.1Introduction
13.2Starting to Program the Classes of the ATM System
13.3Incorporating Inheritance and Polymorphism into the ATM System
13.4ATM Case Study Implementation
13.5WrapUp
Chapter 14 GUI Components: Part 1
14.1Introduction
14.2Javas New Nimbus LookandFeel
14.3Simple GUIBased Input/Output with JOptionPane
14.4Overview of Swing Components
14.5Displaying Text and Images in a Window
14.6Text Fields and an Introduction to Event Handling with Nested Classes
14.7Common GUI Event Types and Listener Interfaces
14.8How Event Handling Works
14.9JButton
14.10Buttons That Maintain State
14.11JComboBox and Using an Anonymous Inner Class for Event Handling
14.12JList
14.13MultipleSelection Lists
14.14Mouse Event Handling
14.15Adapter Classes
14.16JPanel Subclass for Drawing with the Mouse
14.17Key Event Handling
14.18Introduction to Layout Managers
14.19Using Panels to Manage More Complex Layouts
14.20JTextArea
14.21WrapUp
Chapter 15 Graphics and Java 2D
15.1Introduction
15.2Graphics Contexts and Graphics Objects
15.3Color Control
15.4Manipulating Fonts
15.5Drawing Lines,Rectangles and Ovals
15.6Drawing Arcs
15.7Drawing Polygons and Polylines
15.8Java 2D API
15.9WrapUp
Chapter 16 Strings,Characters and Regular Expressions
16.1Introduction
16.2Fundamentals of Characters and Strings
16.3Class String
16.4Class StringBuilder
16.5 Class Character
16.6 Tokenizing Strings
16.7 Regular Expressions,Class Pattern and Class Matcher
16.8 WrapUp
Chapter 17 Files,Streams and Object Serialization
17.1Introduction
17.2Data Hierarchy
17.3Files and Streams
17.4Class File
17.5SequentialAccess Text Files
17.6Object Serialization
17.7Additional java.io Classes
17.8Opening Files with JFileChooser
17.9WrapUp
Chapter 18 Recursion
18.1Introduction
18.2Recursion Concepts
18.3Example Using Recursion: Factorials
18.4Example Using Recursion: Fibonacci Series
18.5Recursion and the MethodCall Stack
18.6Recursion vs. Iteration
18.7Towers of Hanoi
18.8Fractals
18.9Recursive Backtracking
18.10WrapUp
Chapter 19 Searching,Sorting and Big O
19.1Introduction
19.2Searching Algorithms
19.3 Sorting Algorithms
19.4 WrapUp
Chapter 20 Generic Collections
20.1 Introduction
20.2 Collections Overview
20.3 TypeWrapper Classes for Primitive Types
20.4 Autoboxing and AutoUnboxing
20.5 Interface Collection and Class Collections
20.6 Lists
20.7 Collections Methods
20.8Stack Class of Package java.util
20.9 Class PriorityQueue and Interface Queue
20.10Sets
20.11Maps
20.12Properties Class
20.13Synchronized Collections
20.14Unmodifiable Collections
20.15Abstract Implementations
20.16WrapUp
Chapter 21 Generic Classes and Methods
21.1Introduction
21.2Motivation for Generic Methods
21.3Generic Methods: Implementation and CompileTime Translation
21.4Additional CompileTime Translation Issues: Methods That Use a Type Parameter
as the Return Type
21.5Overloading Generic Methods
21.6Generic Classes
21.7Raw Types
21.8Wildcards in Methods That Accept Type Parameters
21.9Generics and Inheritance: Notes
21.10WrapUp Chapter 22Custom Generic Data Structures
22.1Introduction
22.2SelfReferential Classes
22.3Dynamic Memory Allocation
22.4Linked Lists
22.5Stacks
22.6Queues
22.7Trees
22.8WrapUp
Chapter 23 Applets and Java Web Start
23.1Introduction
23.2Sample Applets Provided with the JDK
23.3Simple Java Applet: Drawing a String
23.4Applet LifeCycle Methods
23.5Initializing an Instance Variable with Method init
23.6Sandbox Security Model
23.7Java Web Start and the Java Network Launch Protocol (JNLP)
23.8WrapUp
Chapter 24 Multimedia: Applets and Applications
24.1Introduction
24.2Loading,Displaying and Scaling Images
24.3Animating a Series of Images
24.4Image Maps
24.5Loading and Playing Audio Clips
24.6Playing Video and Other Media with Java Media Framework
24.7WrapUp
24.8Web Resources Chapter 25GUI Components: Part 2
25.1Introduction
25.2JSlider
25.3Windows: Additional Notes
25.4Using Menus with Frames
25.5JPopupMenu
25.6Pluggable LookandFeel
25.7JDesktopPane and JInternalFrame
25.8JTabbedPane
25.9Layout Managers: BoxLayout and GridBagLayout
25.10WrapUp
Chapter 26 Multithreading
26.1 Introduction
26.2 Thread States: Life Cycle of a Thread
26.3 Thread Priorities and Thread Scheduling
26.4 Creating and Executing Threads
26.5 Thread Synchronization
26.6Producer/Consumer Relationship without Synchronization
26.7Producer/Consumer Relationship: ArrayBlockingQueue
26.8Producer/Consumer Relationship with Synchronization
26.9Producer/Consumer Relationship: Bounded Buffers
26.10Producer/Consumer Relationship: The Lock and Condition Interfaces
26.11Multithreading with GUI
26.12Interfaces Callable and Future
26.13WrapUp
Chapter 27 Networking
27.1Introduction
27.2Manipulating URLs
27.3Reading a File on a Web Server
27.4Establishing a Simple Server Using Stream Sockets
27.5Establishing a Simple Client Using Stream Sockets
27.6Client/Server Interaction with Stream Socket Connections
27.7Connectionless Client/Server Interaction with Datagrams
27.8Client/Server TicTacToe Using a Multithreaded Server
27.9[Web Bonus] Case Study: DeitelMessenger Server and Client
27.10WrapUp
Chapter 28 Accessing Databases with JDBC
28.1Introduction
28.2Relational Databases
28.3Relational Database Overview: The books Database
28.4SQL
28.5Instructions for Installing MySQL and MySQL Connector/J
28.6Instructions for Setting Up a MySQL User Account
28.7Creating Database books in MySQL
28.8Manipulating Databases with JDBC
28.9RowSet Interface
28.10Java DB/Apache Derby
28.11PreparedStatements
28.12Stored Procedures
28.13Transaction Processing
28.14WrapUp
28.15Web Resources
Chapter 29 JavaServer Faces Web Applications
29.1Introduction
29.2Simple HTTP Transactions
29.3Multitier Application Architecture
29.4Java Web Technologies
29.5Creating and Running a Simple Application in NetBeans
29.6JSF Components
29.7Session Tracking
29.8WrapUp
Chapter 30 AjaxEnabled JavaServer Faces Web Applications
30.1Introduction
30.2Accessing Databases in Web Applications
30.3AjaxEnabled JSF Components
30.4Creating an Autocomplete Text Field and Using Virtual Forms
30.5WrapUp
Chapter 31 Web Services
31.1Introduction
31.2Web Service Basics
31.3Simple Object Access Protocol (SOAP)
31.4Representational State Transfer (REST)
31.5JavaScript Object Notation (JSON)
31.6Publishing and Consuming SOAPBased Web Services
31.7Publishing and Consuming RESTBased XML Web Services
31.8Publishing and Consuming RESTBased JSON Web Services
31.9Session Tracking in a SOAPBased Web Service
31.10Consuming a DatabaseDriven SOAPBased Web Service
31.11Equation Generator: Returning UserDefined Types
31.12WrapUp
Appendix A Operator Precedence Chart
Appendix B ASCII Character Set
Appendix C Keywords and Reserved Words
Appendix D Primitive Types
Appendix E Using the Java API Documentation
Appendix F Using the Debugger
Appendix G Formatted Output