Java Programming 英文版PDF电子书下载
- 电子书积分:11 积分如何计算积分?
- 作 者:(新加坡)潘祥春编著
- 出 版 社:北京:清华大学出版社
- 出版年份:2010
- ISBN:9787302207221
- 页数:291 页
CHAPTER 1 The Java Programming Environment1.1 History of Java 2
1.2 Preparing to Write Java Programs 2
1.3 A Simple Java Program 3
1.4 How to Run a Java Program? 4
1.5 Commonly Encountered Problems 5
Workshops 5
Workshop 1.1:Preparing the Environment for Java Programming 5
Workshop 1.2:How to Run a Java Program? 10
Workshop 1.3:How to Compile and Run a Java Program in DOS Prompt? 12
Exercises 13
CHAPTER 2 The Java Language Components 17
2.1 Print2Numbers Java Program 17
2.2 The Java Vocabulary and Character Sets 19
2.3 Primitive Data Types 19
2.3.1 Boolean 20
2.3.2 Characters 20
2.3.3 Integers 21
2.3.4 Floating Point 22
2.3.5 Object References 22
2.3.6 String 22
2.4 Identifiers 22
2.5 Reserved Words 23
2.6 Comments 24
2.7 Basic Program Structure 25
Workshops 26
Workshop 2.1:Understanding the Sequence of Program Execution 26
Exercises 28
CHAPTER 3 Expressions,Statements and Operators3.1 Expression Statements 31
3.1.1 Types of Expressions 31
3.1.2 Assignment Expression Statements 31
3.1.3 Prefix or Postfix Forms of“++”and“--”Statements 32
3.1.4 Method Call Statements 32
3.1.5 Object Creation Statements 32
3.2 Declaration Statements 33
3.3 Operators 33
3.3.1 Arithmetic Operators 34
3.3.2 Auto-Increment and Auto-Decrement Operators 35
3.3.3 Logical Operators 35
3.3.4 Relational Operators 37
3.3.5 Bitwise Operators 39
3.3.6 The Conditional Operator“?:” 40
3.3.7 Assignment Operators 41
3.3.8 “+”Operator 43
3.3.9 “.”Operator 44
3.3.10 Precedence and Associativity 44
Workshops 47
Workshop 3.1:Entering Data for Program Execution 47
Exercises 53
CHAPTER 4 Program Flow Controls 56
4.1 Sequence 56
4.2 Selection 57
4.2.1 Block 57
4.2.2 Types of Selection Statements 59
4.3 Iteration 64
4.3.1 The while Statement 64
4.3.2 The do-while Statement 66
4.3.3 The for Statement 67
4.3.4 The Enhanced 'for' Statement 70
4.4 Labels 70
4.5 The break Statement 71
4.6 The continue Statement 71
Exercises 71
CHAPTER 5 Arrays 75
5.1 Array 75
5.1.1 Declaring and Creating an Array 75
5.1.2 Initializing an Array 77
5.1.3 Using Arrays 77
5.2 Two-dimensional Arrays 79
5.2.1 One-dimensional Array Approach 79
5.2.2 Two-dimensional Array Approach 80
5.2.3 Populating Two-dimensional Arrays 82
5.3 Applying the Enhanced 'for' Statement in Arrays 83
5.4 An Application:Printing Numbers Divisible by 3 84
5.4.1 Using Label and break Statement 85
5.4.2 Using continue Statement 88
Workshops 90
Workshop 5.1:Copying Arrays 90
Exercises 96
CHAPTER 6 Methods 98
6.1 Defining a Problem 98
6.2 A Problem Solving Approach 99
6.3 Improving the Problem-Solving Approach 103
6.3.1 Advantage of Using Methods 107
6.3.2 Walking Through readInputValues() Method 107
6.3.3 Walking Through convertMarksToGrades() Method 107
6.3.4 Walking Through printDetails() Method 107
6.4 Block Structure and Scope 108
6.4.1 Local Variables 108
6.4.2 Global Variables 109
6.4.3 Determining Scope of Variables across Methods 110
6.4.4 Distinguishing Local Variables from Global Variables 111
6.4.5 Scope of Identifier Declaration 112
6.5 Parameters 113
6.5.1 Actual and Formal Parameters 113
6.5.2 Value Parameters 117
6.6 Methods that Return Values 119
6.6.1 Returning Values 119
6.6.2 The return Statement 121
Workshops 121
Workshop 6.1:Using Methods 121
Exercises 125
CHAPTER 7 Class and Objects 128
7.1 Class and Objects 128
7.2 Constructing Objects 128
7.2.1 Constructors 129
7.2.2 Multiple Constructor Method Definition 131
7.2.3 Constructor Method Invocation 133
7.3 Instance and Class Variables 134
7.4 Instance and Class Methods 135
7.4.1 Instance Methods 135
7.4.2 Class Methods 136
7.5 Constants 138
7.6 The this Keyword 139
7.6.1 Using this Keyword in Instance Method 140
7.6.2 Using this Keyword in Constructor 141
7.7 Inner Class 141
7.7.1 Compiling an Inner Class 142
7.7.2 Static Inner Class 143
7.7.3 Creating Inner Class Objects 143
7.8 Class Hierarchy 143
7.8.1 Superclass and Subclass 144
7.8.2 Inheritance 146
Workshops 148
Workshop 7.1:Implementing Class and Objects 148
Exercises 153
CHAPTER 8 The Java Application Programming Interface(API)8.1 Java Package 157
8.1.1 The'package'Keyword 158
8.1.2 The'import'Keyword 159
8.1.3 File Name of a Public Class 161
8.2 The JavaTM Platform Standard Edition 162
8.3 The Java API 162
8.3.1 The Java API Documentation 163
8.3.2 The Java API Packages 164
8.3.3 Directory Structure of Java API Packages 167
8.3.4 The java.lang,java.io,and java.util Packages 168
8.3.5 Reading the Java API Documentation 168
8.3.6 Using the Java API 169
8.4 The Ubiquitous System.out.println() Method 170
8.4.1 The System Class 170
8.4.2 The PrintStream Class 171
8.5 String Tokenizers 173
8.5.1 The java.util.StringTokenizer Class 173
8.5.2 Delimiter Characters 175
Exercises 176
CHAPTER 9 Inputs and Outputs 178
9.1 Input and Output Streams 178
9.1.1 Screen Outputs 178
9.1.2 Keyboard Inputs 179
9.1.3 Reading and Displaying Texts 180
9.2 Exception Handling 181
9.2.1 Java Exception Handling 181
9.2.2 Explicit Exception Handling 182
9.3 The Scanner Class 185
9.3.1 Creating a Scanner Object 186
9.3.2 Handling Numerical Data Types 186
9.3.3 Handling String Values 186
9.3.4 Handling Boolean Values 186
9.3.5 Exceptions and Delimiters 187
9.3.6 A Scanner Class Application 188
Exercises 190
CHAPTER 10 File Handling 193
10.1 Text Files 193
10.1.1 Writing to a Text File 193
10.1.2 Appending Texts to a File 195
10.1.3 Reading from a File 195
10.2 Binary Files 196
Exercises 198
CHAPTER 11 Inheritance 199
11.1 The Inheritance Mechanism 199
11.1.1 Subclass and Superclass 199
11.1.2 java.lang.Object Class 200
11.1.3 Downward Property Propagation 200
11.2 Demonstrating Inheritance 200
11.3 The super Keyword 202
11.3.1 Syntax 202
11.3.2 Constructor Chaining 203
11.3.3 Calling Superclass Methods 205
11.4 Method Overriding 205
Exercises 207
CHAPTER 12 Encapsulation 216
12.1 Access Modifiers:public,protected,private 216
12.1.1 Using Access Modifiers 216
12.1.2 Accessibility Effects 217
12.2 Data Field Encapsulation 218
12.3 Class Abstraction 219
12.4 Class Encapsulation 220
12.4.1 Encapsulating a Class 220
12.4.2 Enhanced Maintainability 222
12.4.3 Bundling and Information Hiding 225
Exercises 226
CHAPTER 13 Polymorphism 229
13.1 Illustrating Polymorphism with Geometric Shapes 229
13.1.1 The Triangle Class 230
13.1.2 The Rectangle Class 231
13.1.3 The GeometricShape Class 233
13.1.4 The User Class:GeometricShapeMain Class 234
13.2 Abstract Class 235
13.3 Dynamic Binding 236
Exercises 237
CHAPTER 14 Interface 239
14.1 The Interface Construct 239
14.2 Interface Definition 239
14.2.1 Interface Declaration and Interface Body 240
14.2.2 Compilation of Interface 241
14.2.3 Implementing Interface 241
14.3 Understanding the Use of Interface 243
14.4 What and How in the Use of Interface 244
14.5 Application of Interface 245
14.5.1 Sales Person Application 245
14.5.2 SalesPerson and Employee Class 247
14.5.3 Sort by Age:The main() Method 1 248
14.5.4 Sort by Name:The main() Method 2 250
14.5.5 Sort by Wage:The main() Method 3 251
14.5.6 The Output 251
14.6 The Serializable Interface 252
14.7 Interface and Abstract Class 257
14.8 Changes in Interface 257
14.9 Uses of Interface 258
Exercises 258
CHAPTER 15 Sorting,Searching,and Recursion15.1 Sorting 264
15.1.1 Selection Sort 264
15.1.2 Bubble Sort 267
15.1.3 A Sorting Application 269
15.2 Searching 273
15.2.1 Linear Search 273
15.2.2 Binary Search 274
15.2.3 A Searching Application 276
15.3 Recursion 280
15.3.1 Recursive Method 281
15.3.2 Writing a Recursive Method 284
15.3.3 The Ubiquitous Factorial 284
15.3.4 Applying Recursion 285
- 《卓有成效的管理者 中英文双语版》(美)彼得·德鲁克许是祥译;那国毅审校 2019
- 《AutoCAD 2018自学视频教程 标准版 中文版》CAD/CAM/CAE技术联盟 2019
- 《跟孩子一起看图学英文》张紫颖著 2019
- 《AutoCAD机械设计实例精解 2019中文版》北京兆迪科技有限公司编著 2019
- 《复分析 英文版》(中国)李娜,马立新 2019
- 《张世祥小提琴启蒙教程 中英文双语版》张世祥编著 2017
- 《生物化学 本科临床 英文版》张晓伟 2018
- 《理想国 全英文原版》(古希腊)柏拉图著 2017
- 《Dreamweaver CC 2018标准实例教程 中文版》杨雪静,胡仁喜编著 2019
- 《Flash CC动画制作实用教程 中文版》麓山文化 2019
- 《市政工程基础》杨岚编著 2009
- 《家畜百宝 猪、牛、羊、鸡的综合利用》山西省商业厅组织技术处编著 1959
- 《《道德经》200句》崇贤书院编著 2018
- 《高级英语阅读与听说教程》刘秀梅编著 2019
- 《计算机网络与通信基础》谢雨飞,田启川编著 2019
- 《海明威书信集:1917-1961 下》(美)海明威(Ernest Hemingway)著;潘小松译 2019
- 《看图自学吉他弹唱教程》陈飞编著 2019
- 《法语词汇认知联想记忆法》刘莲编著 2020
- 《培智学校义务教育实验教科书教师教学用书 生活适应 二年级 上》人民教育出版社,课程教材研究所,特殊教育课程教材研究中心编著 2019
- 《国家社科基金项目申报规范 技巧与案例 第3版 2020》文传浩,夏宇编著 2019
- 《大学计算机实验指导及习题解答》曹成志,宋长龙 2019
- 《指向核心素养 北京十一学校名师教学设计 英语 七年级 上 配人教版》周志英总主编 2019
- 《大学生心理健康与人生发展》王琳责任编辑;(中国)肖宇 2019
- 《大学英语四级考试全真试题 标准模拟 四级》汪开虎主编 2012
- 《大学英语教学的跨文化交际视角研究与创新发展》许丽云,刘枫,尚利明著 2020
- 《北京生态环境保护》《北京环境保护丛书》编委会编著 2018
- 《复旦大学新闻学院教授学术丛书 新闻实务随想录》刘海贵 2019
- 《大学英语综合教程 1》王佃春,骆敏主编 2015
- 《大学物理简明教程 下 第2版》施卫主编 2020
- 《指向核心素养 北京十一学校名师教学设计 英语 九年级 上 配人教版》周志英总主编 2019