Java大学教程-(第九版)-(英文版) 本书特色
本书是关于Java语言编程的优秀教材之一,秉承Deitel系列丛书的一贯特点:内容丰富、覆盖面广,提供详细代码与实例研究,总结出大量的面向对象编程技巧和经验。本书详细说明了在Java中面向对象编程的基本理论及实用知识,由初学者为起点,由点到面、由浅入深、循序渐进地介绍了事件处理、对象、接口、内置类、继承、多态性、数据结构和集合、查找与排序、流文件、applet、图形用户界面及多线程等,并且详细介绍了网络应用的开发与实践。第九版在前一版的基础上增加了更多的实际案例,更新了很多内容,有助于读者学习和借鉴。本书包括更广泛的教学特性,其中列举了数百个可实际使用的程序实例,并给出实际的运行结果,可以使学生在学习时更为直观。
Java大学教程-(第九版)-(英文版) 内容简介
学习Java语言的经典教材之一:
*提供了很多的基础的、覆盖面很广的实例。
*丰富的教辅资源,源代码可直接使用。
*网络应用的开发与实践。
*内容全面,适合不同层次的读者需求。
Java大学教程-(第九版)-(英文版) 目录
Contents
Chapter 1 Introduction to Computers and Java 1
1.1 Introduction 2
1.2 Computers: Hardware and Software 4
1.3 Data Hierarchy 5
1.4 Computer Organization 6
1.5 Machine Languages, Assembly Languages and High-Level Languages 7
1.6 Introduction to Object Technology 8
1.7 Operating Systems 10
1.8 Programming Languages 12
1.9 Java and a Typical Java Development Environment 14
1.10 Test-Driving a Java Application 17
1.11 Web 2.0: Going Social 21
1.12 Software Technologies 23
1.13 Keeping Up-to-Date with Information Technologies 24
1.14 Wrap-Up 24
Chapter 2 Introduction to Java Applications 29
2.1 Introduction 29
2.2 Your First Program in Java: Printing a Line of Text 30
2.3 Modifying Your First Java Program 35
2.4 Displaying Text with printf 36
2.5 Another Application: Adding Integers 37
2.6 Memory Concepts 41
2.7 Arithmetic 42
2.8 Decision Making: Equality and Relational Operators 45
2.9 Wrap-Up 48
Chapter 3 Introduction to Classes, Objects, Methods and Strings 58
3.1 Introduction 58
3.2 Declaring a Class with a Method and Instantiating an Object of a Class 59
3.3 Declaring a Method with a Parameter 62
3.4 Instance Variables, set Methods and get Methods 64
3.5 Primitive Types vs. Reference Types 68
3.6 Initializing Objects with Constructors 69
3.7 Floating-Point Numbers and Type double 71
3.8 (Optional) GUI and Graphics Case Study: Using Dialog Boxes 75
3.9 Wrap-Up 77
Chapter 4 Control Statements: Part 1 84
4.1 Introduction 85
4.2 Algorithms 85
4.3 Pseudocode 85
4.4 Control Structures 86
4.5 if Single-Selection Statement 88
4.6 if…else Double-Selection Statement 89
4.7 while Repetition Statement 92
4.8 Formulating Algorithms: Counter-Controlled Repetition 93
4.9 Formulating Algorithms: Sentinel-Controlled Repetition 97
4.10 Formulating Algorithms: Nested Control Statements 103
4.11 Compound Assignment Operators 107
4.12 Increment and Decrement Operators 107
4.13 Primitive Types 110
4.14 (Optional) GUI and Graphics Case Study: Creating Simple Drawings 110
4.15 Wrap-Up 113
Chapter 5 Control Statements: Part 2 126
5.1 Introduction 126
5.2 Essentials of Counter-Controlled Repetition 127
5.3 for Repetition Statement 128
5.4 Examples Using the for Statement 131
5.5 do…while Repetition Statement 135
5.6 switch Multiple-Selection Statement 136
5.7 break and continue Statements 142
5.8 Logical Operators 144
5.9 Structured Programming Summary 148
5.10 (Optional) GUI and Graphics Case Study: Drawing Rectangles and Ovals 152
5.11 Wrap-Up 154
Chapter 6 Methods: A Deeper Look 164
6.1 Introduction 165
6.2 Program Modules in Java 165
6.3 static Methods, static Fields and Class Math 166
6.4 Declaring Methods with Multiple Parameters 168
6.5 Notes on Declaring and Using Methods 171
6.6 Method-Call Stack and Activation Records 172
6.7 Argument Promotion and Casting 172
6.8 Java API Packages 173
6.9 Case Study: Random-Number Generation 175
6.10 Case Study: A Game of Chance; Introducing Enumerations 179
6.11 Scope of Declarations 182
6.12 Method Overloading 184
6.13 (Optional) GUI and Graphics Case Study: Colors and Filled Shapes 186
6.14 Wrap-Up 188
Chapter 7 Arrays and ArrayLists 201
7.1 Introduction 202
7.2 Arrays 202
7.3 Declaring and Creating Arrays 203
7.4 Examples Using Arrays 204
7.5 Case Study: Card Shuffling and Dealing Simulation 212
7.6 Enhanced for Statement 215
7.7 Passing Arrays to Methods 216
7.8 Case Study: Class GradeBook Using an Array to Store Grades 219
7.9 Multidimensional Arrays 223
7.10 Case Study: Class GradeBook Using a Two-Dimensional Array 226
7.11 Variable-Length Argument Lists 230
7.12 Using Command-Line Arguments 232
7.13 Class Arrays 233
7.14 Introduction to Collections and Class ArrayList 235
7.15 (Optional) GUI and Graphics Case Study: Drawing Arcs 237
7.16 Wrap-Up 240
Chapter 8 Classes and Objects: A Deeper Look 259
8.1 Introduction 260
8.2 Time Class Case Study 260
8.3 Controlling Access to Members 263
8.4 Referring to the Current Object’s Members with the this Reference 264
8.5 Time Class Case Study: Overloaded Constructors 266
8.6 Default and No-Argument Constructors 270
8.7 Notes on Set and Get Methods 271
8.8 Composition 272
8.9 Enumerations 274
8.10 Garbage Collection and Method finalize 276
8.11 static Class Members 277
8.12 static Import 280
8.13 final Instance Variables 281
8.14 Time Class Case Study: Creating Packages 282
8.15 Package Access 286
8.16 (Optional) GUI and Graphics Case Study: Using Objects with Graphics 287
8.17 Wrap-Up 290
Chapter 9 Object-Oriented Programming: Inheritance 298
9.1 Introduction 298
9.2 Superclasses and Subclasses 299
9.3 protected Members 301
9.4 Relationship between Superclasses and Subclasses 302
9.5 Constructors in Subclasses 318
9.6 Software Engineering with Inheritance 319
9.7 Class Object 320
9.8 (Optional) GUI and Graphics Case Study: Displaying Text and Images Using Labels 320
9.9 Wrap-Up 322
Chapter 10 Object-Oriented Programming: Polymorphism 326
10.1 Introduction 327
10.2 Polymorphism Examples 328
10.3 Demonstrating Polymorphic Behavior 329
10.4 Abstract Classes and Methods 331
10.5 Case Study: Payroll System Using Polymorphism 333
10.6 final Methods and Classes 346
10.7 Case Study: Creating and Using Interfaces 346
10.8 (Optional) GUI and Graphics Case Study: Drawing with Polymorphism 356
10.9 Wrap-Up 357
Chapter 11 Exception Handling: A Deeper Look 362
11.1 Introduction 363
11.2 Example: Divide by Zero without Exception Handling 363
11.3 Example: Handling ArithmeticExceptions and InputMismatchExceptions 365
11.4 When to Use Exception Handling 369
11.5 Java Exception Hierarchy 369
11.6 finally Block 372
11.7 Stack Unwinding and Obtaining Information from an Exception Object 375
11.8 Chained Exceptions 378
11.9 Declaring New Exception Types 379
11.10 Preconditions and Postconditions 380
11.11 Assertions 381
11.12 (New in Java SE 7) Multi-catch: Handling Multiple Exceptions in One catch 382
11.13 (New in Java SE 7) try-with-Resources: Automatic Resource Deallocation 382
11.14 Wrap-Up 383
Chapter 12 ATM Case Study, Part 1: Object-Oriented Design with the UML 388
12.1 Case Study Introduction 388
12.2 Examining the Requirements Document 389
12.3 Identifying the Classes in a Requirements Document 395
12.4 Identifying Class Attributes 400
12.5 Identifying Objects’ States and Activities 404
12.6 Identifying Class Operations 407
12.7 Indicating Collaboration Among Objects 412
12.8 Wrap-Up 418
Chapter 13 ATM Case Study Part 2: Implementing an Object-Oriented Design 421
13.1 Introduction 422
13.2 Starting to Program the Classes of the ATM System 422
13.3 Incorporating Inheritance and Polymorphism into the ATM System 425
13.4 ATM Case Study Implementation 431
13.5 Wrap-Up 449
Chapter 14 GUI Components: Part 1 451
14.1 Introduction 452
14.2 Java’s New Nimbus Look-and-Feel 453
14.3 Simple GUI-Based Input/Output with JOptionPane 454
14.4 Overview of Swing Components 456
14.5 Displaying Text and Images in a Window 457
14.6 Text Fields and an Introduction to Event Handling with Nested Classes 461
14.7 Common GUI Event Types and Listener Interfaces 466
14.8 How Event Handling Works 467
14.9 JButton 468
14.10 Buttons That Maintain State 471
14.11 JComboBox; Using an Anonymous Inner Class for Event Handling 476
14.12 JList 479
14.13 Multiple-Selection Lists 480
14.14 Mouse Event Handling 482
1
Java大学教程-(第九版)-(英文版) 作者简介
Paul Deitel和Harvey Deitel是全球畅销的编程语言教材和专业图书作家,“How to Program”系列是其最负盛名的一套计算机编程教材,已经销售近40年,并被翻译成中文在内的十几种语言。他们成立的Deitel & Associates公司是一家国际知名的企业培训和写作公司, 专门进行计算机编程语言、对象技术、移动应用开发及Internet和Web软件技术方面的培训和写作,出版了一流的编程专业的大学教材、
专业图书以及LiveLessons视频课程。