资源详情

Java核心技术速学版(第3版)

Java核心技术速学版(第3版)-电子书下载


作者: [美]凯·S.霍斯特曼(Cay S. Horstmann)
出版社: 人民邮电出版社
出品方: 异步图书
译者: 曹良亮
出版年: 2024-5
页数: 400
定价: 99.80元
装帧: 平装
ISBN: 9787115626097

下载次数:0


本站推荐

书籍资料

  • 内容简介
  • 作者介绍
  • 书籍目录
本书是经典Java开发基础书《Java核心技术》的速学版本。
本书首先介绍了Java语言的基础知识;其次介绍了流、输入和输出处理、并发、注解、日期和时间 API、国际化、编译和脚本、Java 平台模块系统等高级特性。
本书不仅可以让读者深入了解Java编程的基础知识和核心概念,还可以帮助读者掌握Java应用程序开发所需的基本技能。
本书涵盖了Java 17中更新的内容,提供了许多实用的示例代码,还给出了基于作者实际经验的提示、注意和警告。
凯·S.霍斯特曼(Cay S.Horstmann),《Java 核心技术(原书第 12 版)》两卷本(Core Java, Volumes I and II, Twelfth Edition)的主要作者,他还为专业编程人员和计算机科学专业的学生撰写了十多本书。他是美国圣何塞州立大学计算机专业的科学荣誉退休教授,也是一名Java Champion。
第1章基本编程结构.....................................1
1.1我们的第一个程序...................................1
1.1.1剖析“Hello,World”程序............1
1.1.2编译和运行Java程序...................2
1.1.3方法调用........................................4
1.1.4JShell..............................................4
1.2基本类型...................................................6
1.2.1有符号整数类型............................7
1.2.2浮点类型..

.....................................7
1.2.3char类型.....................................8
1.2.4boolean类型..............................8
1.3变量...........................................................8
1.3.1变量声明........................................8
1.3.2标识符............................................9
1.3.3初始化............................................9
1.3.4常量................................................9
1.4算术运算.................................................10
1.4.1赋值..............................................11
1.4.2基本算术运算符..........................11
1.4.3数学方法......................................12
1.4.4数值的类型转换..........................12
1.4.5关系运算符和逻辑运算符..........13
1.4.6大数..............................................14
1.5字符串.....................................................14
1.5.1拼接..............................................14
1.5.2子串..............................................15
1.5.3字符串比较..................................15
1.5.4数值和字符串的相互转换..........16
1.5.5字符串API..................................16
1.5.6码点和代码单元..........................18
1.5.7文本块..........................................19
1.6输入和输出.............................................20
1.6.1读取输入......................................20
1.6.2格式化输出..................................21
1.7控制流.....................................................22
1.7.1分支..............................................23
1.7.2switch语句...............................23
1.7.3循环..............................................24
1.7.4break和continue.................25
1.7.5局部变量的作用域......................26
1.8数组和数组列表.....................................27
1.8.1使用数组.....................................27
1.8.2数组构造.....................................28
1.8.3数组列表.....................................28
1.8.4基本类型的封装类......................29
1.8.5增强for循环............................30
1.8.6复制数组和数组列表..................30
1.8.7数组算法.....................................31
1.8.8命令行参数.................................31
1.8.9多维数组.....................................31
1.9功能分解................................................33
1.9.1声明和调用静态方法..................33
1.9.2数组参数和返回值......................33
1.9.3可变参数.....................................34
练习..............................................................34
第2章面向对象编程...................................36
2.1使用对象................................................36
2.1.1访问器方法和修改器方法..........37
2.1.2对象引用.....................................38
2.2实现类....................................................39
2.2.1实例变量.....................................39
2.2.2方法头.........................................39
2.2.3方法体.........................................39
2.2.4实例方法调用.............................40
2.2.5this引用...................................40
2.2.6按值调用.....................................41
2.3对象构造................................................42
2.3.1实现构造器.................................42
2.3.2重载.............................................42
2.3.3从一个构造器调用另一个构造器........................43
2.3.4默认初始化.................................43
2.3.5实例变量初始化.........................43
2.3.6final实例变量........................44
2.3.7无参数构造器.............................44
2.4记录........................................................44
2.4.1记录的概念.................................45
2.4.2构造器:标准的、自定义的和简洁的....................46
2.5静态变量和静态方法............................46
2.5.1静态变量.....................................46
2.5.2静态常量.....................................47
2.5.3静态初始化块..............................47
2.5.4静态方法......................................47
2.5.5工厂方法......................................48
2.6包..................................................49
2.6.1包声明..........................................49
2.6.2jar命令......................................49
2.6.3类路径..........................................50
2.6.4包访问..........................................51
2.6.5导入类..........................................51
2.6.6静态导入......................................52
2.7嵌套类.............................................52
2.7.1静态嵌套类..................................52
2.7.2内部类..........................................53
2.7.3内部类的特殊语法规则..............54
2.8文档注释.................................................55
2.8.1注释插入......................................55
2.8.2类注释..........................................56
2.8.3方法注释......................................56
2.8.4变量注释......................................56
2.8.5通用注释......................................57
2.8.6链接..............................................57
2.8.7包注释、模块注释和概述注释..................................57
2.8.8注释提取......................................58
练习..............................................................58
第3章接口和Lambda表达式.................60
3.1接口.........................................................60
3.1.1使用接口......................................60
3.1.2声明接口......................................61
3.1.3实现接口......................................61
3.1.4转换为接口类型..........................62
3.1.5强制转换和instanceof运算符..................................63
3.1.6instanceof的“模式匹配”形式................................63
3.1.7扩展接口......................................64
3.1.8实现多个接口..............................64
3.1.9常量..............................................64
3.2静态方法、默认方法和私有方法.........64
3.2.1静态方法......................................65
3.2.2默认方法......................................65
3.2.3解决默认方法冲突......................65
3.2.4私有方法......................................66
3.3接口示例.................................................66
3.3.1Comparable接口.....................67
3.3.2Comparator接口.....................68
3.3.3Runnable接口..........................68
3.3.4用户界面回调..............................68
3.4Lambda表达式......................................69
3.4.1Lambda表达式的语法................69
3.4.2函数式接口.................................70
3.5方法引用和构造器引用.........................71
3.5.1方法引用.....................................71
3.5.2构造器引用.................................71
3.6处理Lambda表达式.............................72
3.6.1实现延迟执行.............................72
3.6.2选择函数式接口.........................73
3.6.3实现自己的函数式接口..............74
3.7Lambda表达式作用域和变量作用域...74
3.7.1Lambda表达式作用域................75
3.7.2封闭作用域内访问变量..............75
3.8高阶函数......................................76
3.8.1返回函数的方法.........................76
3.8.2修改函数的方法.........................77
3.8.3Comparator方法.....................77
3.9局部类和匿名类....................................78
3.9.1局部类.........................................78
3.9.2匿名类.........................................78
练习..............................................................79
第4章继承与反射.......................................81
4.1扩展类....................................................81
4.1.1超类和子类.................................81
4.1.2定义和继承子类方法..................82
4.1.3方法覆盖.....................................82
4.1.4子类构造.....................................83
4.1.5超类赋值.....................................83
4.1.6强制类型转换.............................84
4.1.7匿名子类.....................................84
4.1.8带super的方法表达式............84
4.2继承的层次结构....................................85
4.2.1final方法和final类...........85
4.2.2抽象方法和抽象类......................85
4.2.3受保护的访问.............................86
4.2.4密封类.........................................86
4.2.5继承和默认方法.........................88
4.3Object:宇宙级超类..........................88
4.3.1toString方法.........................89
4.3.2equals方法..............................90
4.3.3hashCode方法.........................91
4.3.4克隆对象.....................................92
4.4枚举........................................................94
4.4.1枚举的方法.................................94
4.4.2构造器、方法和字段..................94
4.4.3实例的主体.................................95
4.4.4静态成员.....................................95
4.4.5switch中的枚举......................96
4.5运行时类型信息和资源.........................96
4.5.1Class类.....................................96
4.5.2加载资源......................................98
4.5.3类加载器......................................98
4.5.4上下文类加载器..........................99
4.5.5服务加载器................................100
4.6反射.......................................................101
4.6.1枚举类的成员............................101
4.6.2检查对象....................................102
4.6.3调用方法....................................102
4.6.4构造对象....................................103
4.6.5JavaBeans...................................103
4.6.6使用数组....................................104
4.6.7代理............................................105
练习............................................................106
第5章异常、断言和日志........................108
5.1异常处理...............................................108
5.1.1抛出异常....................................108
5.1.2异常层次结构............................109
5.1.3声明检查型异常........................110
5.1.4捕获异常....................................110
5.1.5带资源的try语句...................111
5.1.6finally子句..........................112
5.1.7重新抛出异常和链接异常........113
5.1.8未捕获的异常和栈跟踪............114
5.1.9抛出异常的API方法................114
5.2断言.......................................................115
5.2.1使用断言....................................115
5.2.2启用和禁用断言........................115
5.3日志.......................................................116
5.3.1是否应使用Java日志框架.......116
5.3.2日志记录基础............................116
5.3.3平台日志API.............................117
5.34日志记录配置............................118
5.3.5日志处理程序............................118
5.3.6过滤器和格式化器....................120
练习............................................................121
第6章泛型编程..........................................123
6.1泛型类...................................................123
6.2泛型方法...............................................124
6.3类型限定...............................................124
6.4类型差异和通配符...............................125
6.4.1子类型通配符............................125
6.4.2超类型通配符............................126
6.4.3带类型变量的通配符................127
6.4.4无限定通配符............................127
6.4.5通配符捕获................................128
6.5Java虚拟机中的泛型...........................128
6.5.1类型擦除...................................128
6.5.2强制类型转换插入....................129
6.5.3桥接方法...................................129
6.6泛型的限制..........................................130
6.6.1无基本类型参数.......................130
6.6.2运行时所有类型都是原始的....130
6.6.3无法实例化类型变量................131
6.6.4不能构造参数化类型的数组....132
6.6.5类类型变量在静态上下文中无效............................132
6.6.6擦除后方法不能发生冲突........133
6.6.7异常和泛型...............................133
6.7反射和泛型..........................................134
6.7.1Class类............................134
6.7.2虚拟机中的泛型类型信息........135
练习............................................................136
第7章容器...................................................138
7.1容器框架概述......................................138
7.2迭代器..................................................140
7.3集合......................................................141
7.4映射......................................................142
7.5其他容器..............................................144
7.5.1属性...........................................144
7.5.2位集...........................................145
7.5.3枚举集合和枚举映射................146
7.5.4栈、队列、双向队列和优先队列..........................146
7.5.5弱哈希映射...............................147
7.6视图......................................................147
7.6.1小型容器...................................147
7.6.2范围...........................................148
7.6.3不可修改视图...........................148
练习............................................................149
第8章流........................................................151
8.1从迭代到流操作..................................151
8.2流的创建..............................................152
8.3filter、map和flatMap方法.....153
8.4提取子流和组合流..............................155
8.5其他流转换..........................................155
8.6简单约简..............................................156
8.7Optional类型.......................................156
8.7.1生成替代值...............................156
8.7.2值存在就消费值.......................157
8.7.3流水线化Optional值................157
8.7.4不使用Optional值的方式........157
8.7.5创建Optional值.......................158
8.7.6用flatMap合成Optional值函数......................158
8.7.7将Optional转换为流................159
8.8收集结果...............................................159
8.9收集到映射中.......................................160
8.10分组和分区.........................................161
8.11下游收集器.........................................161
8.12约简操作.............................................163
8.13基本类型流.........................................164
8.14并行流.................................................165
练习............................................................166
第9章输入和输出处理.............................168
9.1输入/输出流、读取器和写入器..........168
9.1.1获取流........................................168
9.1.2字节的读取................................169
9.1.3字节的写入................................169
9.1.4字符编码....................................170
9.1.5文本输入....................................171
9.1.6文本输出....................................172
9.1.7二进制数据的读写....................173
9.1.8随机访问文件............................173
9.1.9内存映射文件............................173
9.1.10文件锁定..................................174
9.2路径、文件和目录...............................174
9.2.1路径............................................174
9.2.2创建文件和目录........................175
9.2.3复制、移动和删除文件............176
9.2.4访问目录条目............................177
9.2.5ZIP文件系统.............................178
9.3HTTP连接............................................179
9.3.1URLConnection类和HttpURLConnection类...179
9.3.2HTTP客户端API......................180
9.4正则表达式...........................................181
9.4.1正则表达式语法........................181
9.4.2检测匹配....................................183
9.4.3查找所有匹配............................184
9.4.4分组............................................184
9.4.5按分隔符拆分............................185
9.4.6替换匹配....................................185
9.4.7标志............................................186
9.5序列化...................................................186
9.5.1Serializable接口..............186
9.5.2瞬态实例变量............................187
9.5.3readObject和writeObject方法......................188
9.5.4readExternal和writeExternal方法............189
9.5.5readResolve和writeReplace方法.........189
9.5.6版本管理...................................190
9.5.7反序列化和安全性....................191
练习............................................................192
第10章并发编程.......................................194
10.1并发任务............................................194
10.1.1运行任务.................................194
10.1.2Future...................................196
10.2异步计算............................................197
10.2.1可完成Future......................197
10.2.2组合可完成Future..............198
10.2.3用户界面回调中的长时间运行任务..........................200
10.3线程安全............................................201
10.3.1可见性.....................................201
10.3.2竞争条件.................................202
10.3.3安全并发策略.........................203
10.3.4不可变类.................................204
10.4并行算法............................................204
10.4.1并行流.....................................204
10.4.2并行数组操作.........................205
10.5线程安全数据结构............................205
10.5.1并发哈希映射.........................206
10.5.2阻塞队列.................................206
10.5.3其他线程安全数据结构..........207
10.6原子计数器和累加器........................208
10.7锁和条件............................................209
10.7.1锁.............................................209
10.7.2synchronized关键字.......210
10.7.3等待条件.................................211
10.8线程....................................................212
10.8.1启动线程.................................212
10.8.2线程中断.................................213
10.8.3线程局部变量.........................214
10.8.4其他线程特性.........................214
10.9进程....................................................215
10.9.1创建进程.................................215
10.9.2运行进程.................................216
10.9.3进程句柄.................................217
练习............................................................217
第11章注解.................................................221
11.1使用注解............................................221
11.1.1注解元素..................................221
11.1.2多重注解和重复注解..............222
11.1.3注解声明..................................222
11.1.4类型使用注解..........................223
11.1.5使接收器显式..........................224
11.2定义注解.............................................224
11.3标准注解.............................................226
11.3.1编译用注解..............................226
11.3.2元注解......................................227
11.4在运行时处理注解.............................228
11.5源码级注解处理.................................230
11.5.1注解处理器..............................230
11.5.2语言模型APl...........................230
11.5.3使用注解生成源代码..............231
练习......................................................232
第12章日期和时间API..........................234
12.1时间线.................................................234
12.2本地日期.............................................235
12.3日期调整器.........................................237
12.4本地时间.............................................238
12.5时区时间.............................................238
12.6格式化和解析.....................................240
12.7与遗留代码互操作.............................242
练习............................................................243
第13章国际化.............................................244
13.1区域设置.............................................244
13.1.1指定区域设置..........................245
13.1.2默认区域设置..........................246
13.1.3显示名称..................................247
13.2数值格式.............................................247
13.3货币.....................................................248
13.4日期和时间格式化.............................248
13.5排序和规范化.....................................249
13.6消息格式化.........................................250
13.7资源包.................................................251
13.7.1组织资源包..............................252
13.7.2包类..........................................253
13.8字符编码.............................................253
13.9首选项................................................254
练习............................................................255
第14章编译和脚本...................................256
14.1编译器API.........................................256
14.1.1调用编译器.............................256
14.1.2启动编译任务.........................256
14.1.3捕获诊断信息.........................257
14.1.4从内存读取源文件..................257
14.1.5将字节码写入内存..................257
14.2脚本API.............................................258
14.2.1获取脚本引擎.........................258
14.2.2脚本求值.................................259
14.2.3绑定.........................................259
14.2.4重定向输入和输出..................259
14.2.5调用脚本函数和方法..............260
14.2.6编译脚本.................................260
练习............................................................261
第15章Java平台模块系统....................262
15.1模块的概念........................................262
15.2给模块命名........................................263
15.3模块化“Hello,World!”程序............264
15.4对模块的需求....................................265
15.5导出包................................................266
15.6模块和反射式访问............................267
15.7模块化JAR........................................269
15.8自动模块............................................270
15.9不具名模块........................................271
15.10用于迁移的命令行标志...................271
15.11传递性需求和静态需求...................272
15.12限定导出和开放..............................273
15.13服务加载..........................................273
15.14操作模块的工具..............................274
练习............................................................276