John Lewis教授是美国知名的编程语言畅销教材的作者,撰写了多部有关Java编程导论、Java软件解决方案、Java数据结构以及计算机应用的相关教材。Lewis教授从美国弗吉尼亚大学获得了博士学位并一直在该校任教。
John Lewis教授是美国知名的编程语言畅销教材的作者,撰写了多部有关Java编程导论、Java软件解决方案、Java数据结构以及计算机应用的相关教材。Lewis教授从美国弗吉尼亚大学获得了博士学位并一直在该校任教。
目錄:
目 录
Chapter 1 Introduction 计算机系统概述1
1.1 Computer Processing 计算机处理过程 1
1.2 Hardware Components 硬件组件8
1.3 Networks 网络15
1.4 The Java Programming Language Java编程语言 20
1.5 Program Development 程序开发29
1.6 Object-Oriented Programming 面向对象编程35
Chapter 2 Data and Expressions 数据与表达式44
2.1 Character Strings 字符串44
2.2 Variables and Assignment 变量与赋值50
2.3 Primitive Data Types 基本数据类型54
2.4 Expressions 表达式58
2.5 Data Conversion 数据类型转换65
2.6 Interactive Programs 交互式程序68
Chapter 3 Using Classes and Objects 类与对象77
3.1 Creating Objects 创建对象77
3.2 The String Class String类81
3.3 Packages 包84
3.4 The Random Class Random类87
3.5 The Math Class Math类90
3.6 Formatting Output 格式化输出92
3.7 Enumerated Types 枚举类型97
3.8 Wrapper Classes 包装器类99
3.9 Introduction to JavaFX JavaFX简介101
3.10 Basic Shapes 基本形状104
3.11 Representing Colors 颜色呈现110
Chapter 4 Writing Classes 编写类116
4.1 Classes and Objects Revisited 类与对象的核心概念116
4.2 Anatomy of a Class 类的分析118
4.3 Encapsulation 封装124
4.4 Anatomy of a Method 方法的分析126
4.5 Constructors Revisited 再论构造方法134
4.6 Arcs 弧134
4.7 Images 图形137
4.8 Graphical User Interfaces 图形用户界面140
4.9 Text Fields 文本框143
Chapter 5 Conditionals and Loops 条件判断与循环152
5.1 Boolean Expressions 布尔表达式152
5.2 The if Statement if语句156
5.3 Comparing Data 数据比较167
5.4 The while Statement while语句170
5.5 Iterators 迭代器180
5.6 The ArrayList Class ArrayList类183
5.7 Determining Event Sources 确定事件源186
5.8 Managing Fonts 管理字体188
5.9 Check Boxes 复选框190
5.10 Radio Buttons 单选钮193
Chapter 6 More Conditionals and Loops 其他条件判断与循环204
6.1 The switch Statement switch语句204
6.2 The Conditional Operator 条件运算符208
6.3 The do Statement do语句209
6.4 The for Statement for语句212
6.5 Using Loops and Conditionals with Graphics 对图形使用循环和条件217
6.6 Graphic Transformations 图形转换221
Chapter 7 Object-Oriented Design 面向对象设计232
7.1 Software Development Activities 软件开发活动232
7.2 Identifying Classes and Objects 明确类和对象233
7.3 Static Class Members 静态类成员235
7.4 Class Relationships 类间关系239
7.5 Interfaces 接口250
7.6 Enumerated Types Revisited 再论枚举类型256
7.7 Method Design 方法设计258
7.8 Method Overloading 方法重载267
7.9 Testing 测试269
7.10 GUI Design GUI设计272
7.11 Mouse Events 鼠标事件272
7.12 Key Events 按键事件277
Chapter 8 Arrays 数组285
8.1 Array Elements 数组元素285
8.2 Declaring and Using Arrays 声明和使用数组287
8.3 Arrays of Objects 对象数组295
8.4 Command-Line Arguments 命令行实参304
8.5 Variable Length Parameter Lists 可变长度参数表305
8.6 Two-Dimensional Arrays 二维数组309
8.7 Polygons and Polylines 多边形和折线313
8.8 An Array of Color Objects Color对象数组315
8.9 Choice Boxes 选项框318
Chapter 9 Inheritance 继承328
9.1 Creating Subclasses 创建子类328
9.2 Overriding Methods 重写方法337
9.3 Class Hierarchies 类层次结构340
9.4 Visibility 可见性344
9.5 Designing for Inheritance 继承关系的设计347
9.6 Inheritance in JavaFX JavaFX中的继承349
9.7 Color and Date Pickers 颜色和日期选择器350
9.8 Dialog Boxes 对话框353
Chapter 10 Polymorphism 多态性363
10.1 Late Binding 后绑定363
10.2 Polymorphism via Inheritance 利用继承实现多态性364
10.3 Polymorphism via Interfaces 利用接口实现多态性375
10.4 Sorting 排序377
10.5 Searching 搜索384
10.6 Designing for Polymorphism 多态性设计390
10.7 Properties 属性391
10.8 Sliders 滑动条396
10.9 Spinners 微调器398
Chapter 11 Exceptions 异常403
11.1 Exception Handling 异常处理403
11.2 Uncaught Exceptions 未捕获的异常404
11.3 The try-catch Statement try-catch语句405
11.4 Exception Propagation 异常的传递409
11.5 The Exception Class Hierarchy 异常类层次结构412
11.6 I/O Exceptions I/O异常415
11.7 Tool Tips and Disabling Controls 工具提示与禁用控件419
11.8 Scroll Panes 滚动面板423
11.9 Split Panes and List Views 分隔面板和列表视图424
Chapter 12 Recursion 递归430
12.1 Recursive Thinking 递归思想430
12.2 Recursive Programming 递归编程432
12.3 Using Recursion 递归的应用436
12.4 Tiled Images 平铺图形445
12.5 Fractals 分形448
Chapter 13 Collections 集合458
13.1 Collections and Data Structures 集合与数据结构458
13.2 Dynamic Representations 数据结构的动态表示459
13.3 Linear Collections 线性集合466
13.4 Non-Linear Data Structures 非线性数据结构469
13.5 The Java Collections API Java集合类API471
13.6 Maps 映射472
13.7 Simplifying Declarations Using var 利用var简化声明474
13.8 Lambdas and Collections lambda表达式与集合475
Appendix A Number Systems 数制系统481
Appendix B The Unicode Character Set Unicode字符集487
Appendix C Java Operators Java运算符490
Appendix D Java Modifiers Java修饰符494
Appendix E Java Coding Guidelines Java 编码指南496
Appendix F JavaFX Layout Panes JavaFX布局面板500
Appendix G JavaFX Scene Builder508
Appendix H Regular Expressions 正则表达式516
Appendix I Javadoc Documentation Generator javadoc文档生成器517
Appendix J Java Syntax Java语法521
Appendix K Answers to Self-Review Questions 自测题答案531
Glossary 术语表573