欢迎光临
免费的PDF电子书下载网站

Java核心技术 卷II:高级特性 第11版·英文版 上下册 PDF下载

编辑推荐

·Java领域极具影响力和参考价值的著作 ·曾获Jolt生产效率大奖的Java图书新版 ·Java UI和企业级特性的权威指南——针对Java 11全面更新 对于希望为现实应用程序编写健壮Java代码的有经验的程序员而言,本书是领先且严谨的教程和参考资料,为反映Java 11的改进做了修订,完整覆盖高级UI和企业级编程、网络、安全性和Java强大的新模块系统。 作者深入且完整地探索了Java复杂的新特性,演示了如何使用这些新特性来构建专业级品质的应用程序。作者充分测试过的代码示例,可以展现现代Java风格和*实践。为便于理解和实现实用价值*化,所有示例都经过精心设计,读者可以基于这些代码开启自己的项目。

 ;

内容简介

本书是经典的《Java核心技术 卷Ⅱ:高级特性》的新版。这一版对全书进行了全面更新,以反映Java SE 9、Java SE 10和Java SE 11的特性。 本书是Java技术权威指南,全面覆盖Java技术的高级主题,包括流,输入与输出,XML,网络API,数据库编程,日期与时间API,国际化,脚本、编译与注解处理,Java平台模块系统,安全,本地方法等内容。本书对Java技术的阐述精确到位,叙述方式深入浅出,并包含大量程序示例,从而帮助读者充分理解Java语言以及Java类库的相关高级特性。 本书适合想将Java应用于实际项目的软件开发人员、高等院校教师和学生参考阅读。

作者简介

凯·S. 霍斯特曼(Cay S. Horstmann) 圣何塞州立大学计算机科学教授,“Java大师”(Java Champion)。他是多卷本的《Java核心技术》《写给大忙人看的Java核心技术(第2 版)》以及《快学Scala(第2 版)》的作者。他还编写了很多针对专业程序员和计算机科学专业学生的其他图书。

Java核心技术 卷II:高级特性 第11版·英文版 上下册 PDF下载

目录

Chapter 1: Streams / 流 1

1.1 From Iterating to Stream Operations / 从迭代到流操作 2

1.2 Stream Creation / 流的创建 5

1.3 The filter, map, and flatMap Methods / filter、map和flatMap方法 11

1.4 Extracting Substreams and Combining Streams / 提取子流和组合流 12

1.5 Other Stream Transformations / 其他流变换 14

1.6 Simple Reductions / 简单规约 15

1.7 The Optional Type / Optional类型 16

1.7.1 Getting an Optional Value / 获得Optional值 17

1.7.2 Consuming an Optional Value / 消耗Optional值 17

1.7.3 Pipelining Optional Values / 流水线式的使用Optional值 18

1.7.4 How Not to Work with Optional Values / 避免错误使用Optional值 19

1.7.5 Creating Optional Values / 创建Optional值 20

1.7.6 Composing Optional Value Functions with flatMap / 使用flatMap组合Optional值函数 21

1.7.7 Turning an Optional into a Stream / 将Optional值变到流中 22

1.8 Collecting Results / 收集结果 25

1.9 Collecting into Maps / 收集到Map中 30

1.10 Grouping and Partitioning / 分组与分区 34

1.11 Downstream Collectors / 下游的收集器 36

1.12 Reduction Operations / 规约操作 41

1.13 Primitive Type Streams / 基本类型的流 43

1.14 Parallel Streams / 并行流 48



Chapter 2: Input and Output / 输入与输出 55

2.1 Input / Output Streams / 输入/输出流 56

2.1.1 Reading and Writing Bytes / 读写字节 56

2.1.2 The Complete Stream Zoo / 流谱系概览 59

2.1.3 Combining Input/Output Stream Filters / 组合输入/输出流过滤器 63

2.1.4 Text Input and Output / 文本输入与输出 68

2.1.5 How to Write Text Output / 输出文本 68

2.1.6 How to Read Text Input / 输入文本 70

2.1.7 Saving Objects in Text Format / 以文本格式保存对象 72

2.1.8 Character Encodings / 字符编码 75

2.2 Reading and Writing Binary Data / 读写二进制数据 78

2.2.1 The DataInput and DataOutput interfaces / DataInput和DataOutput接口 78

2.2.2 Random-Access Files / 随机访问文件 80

2.2.3 ZIP Archives / ZIP文档 85

2.3 Object Input/Output Streams and Serialization / 对象输入/输出流与序列化 88

2.3.1 Saving and Loading Serializable Objects / 序列化对象的保存与加载 88

2.3.2 Understanding the Object Serialization File Format / 理解对象序列化文件格式 93

2.3.3 Modifying the Default Serialization Mechanism / 修改默认的序列化机制 100

2.3.4 Serializing Singletons and Typesafe Enumerations / 序列化单例和类型安全的枚举 102

2.3.5 Versioning / 版本管理 103

2.3.6 Using Serialization for Cloning / 将序列化用于克隆 106

2.4 Working with Files / 处理文件 109

2.4.1 Paths / 路径 109

2.4.2 Reading and Writing Files / 读写文件 112

2.4.3 Creating Files and Directories / 创建文件和目录 113

2.4.4 Copying, Moving, and Deleting Files / 复制、移动和删除文件 114

2.4.5 Getting File Information / 获取文件信息 116

2.4.6 Visiting Directory Entries / 访问目录条目 118

2.4.7 Using Directory Streams / 使用目录流 120

2.4.8 ZIP File Systems / ZIP文件系统 123

2.5 Memory-Mapped Files / 内存映射文件 124

2.5.1 Memory-Mapped File Performance / 内存映射文件的性能 125

2.5.2 The Buffer Data Structure / 缓冲区数据结构 132

2.6 File Locking / 文件锁 134

2.7 Regular Expressions / 正则表达式 137

2.7.1 The Regular Expression Syntax / 正则表达式语法 137

2.7.2 Matching a String / 匹配字符串 142

2.7.3 Finding Multiple Matches / 寻找多个匹配字符串 145

2.7.4 Splitting along Delimiters / 使用分隔符分解 147

2.7.5 Replacing Matches / 替换掉匹配字符串 148



Chapter 3: XML 153

3.1 Introducing XML / XML简介 154

3.2 The Structure of an XML Document / XML文档的结构 156

3.3 Parsing an XML Document / 解析XML文档 159

3.4 Validating XML Documents / 验证XML文档 169

3.4.1 Document Type Definitions / 文档类型定义 171

3.4.2 XML Schema / XML模式 179

3.4.3 A Practical Example / 实用示例 182

3.5 Locating Information with XPath / 使用XPath定位信息 188

3.6 Using Namespaces / 使用命名空间 193

3.7 Streaming Parsers / 流解析器 196

3.7.1 Using the SAX Parser / 使用SAX解析器 197

3.7.2 Using the StAX Parser / 使用StAX解析器 202

3.8 Generating XML Documents / 生成XML文档 206

3.8.1 Documents without Namespaces / 不带命名空间的文档 206

3.8.2 Documents with Namespaces / 带命名空间的文档 207

3.8.3 Writing Documents / 写文档 208

3.8.4 Writing an XML Document with StAX / 使用StAX写XML文档 210

3.8.5 An Example: Generating an SVG File / 示例:生成SVG文件 215

3.9 XSL Transformations / XSL转换 216



Chapter 4: Networking / 网络 227

4.1 Connecting to a Server / 连接到服务器 227

4.1.1 Using Telnet / 使用Telnet 227

4.1.2 Connecting to a Server with Java / 使用Java连接到服务器 230

4.1.3 Socket Timeouts / 套接字超时 232

4.1.4 Internet Addresses / 因特网地址 234

4.2 Implementing Servers / 实现服务器 236

4.2.1 Server Sockets / 服务器套接字 236

4.2.2 Serving Multiple Clients / 服务多个客户端 239

4.2.3 Half-Close / 半关闭 243

4.2.4 Interruptible Sockets / 可中断套接字 244

4.3 Getting Web Data / 获取Web数据 251

4.3.1 URLs and URIs / URL和URI 251

4.3.2 Using a URLConnection to Retrieve Information / 使用URLConnection获取信息 254

4.3.3 Posting Form Data / 提交表单数据 261

4.4 The HTTP Client / HTTP客户端 271

4.5 Sending E-Mail / 发送E-Mail 278



Chapter 5: Database Programming / 数据库编程 283

5.1 The Design of JDBC / JDBC的设计 284

5.1.1 JDBC Driver Types / JDBC驱动程序分类 285

5.1.2 Typical Uses of JDBC / JDBC的典型用法 286

5.2 The Structured Query Language / 结构化查询语言 287

5.3 JDBC Configuration / JDBC配置 293

5.3.1 Database URLs / 数据库URL 294

5.3.2 Driver JAR Files / 驱动程序JAR文件 294

5.3.3 Starting the Database / 启动数据库 294

5.3.4 Registering the Driver Class / 注册驱动程序类 295

5.3.5 Connecting to the Database / 连接到数据库 296

5.4 Working with JDBC Statements / 使用JDBC语句 299

5.4.1 Executing SQL Statements / 执行SQL语句 299

5.4.2 Managing Connections, Statements, and Result Sets / 管理连接、语句和结果集 303

5.4.3 Analyzing SQL Exceptions / 分析SQL异常 304

5.4.4 Populating a Database / 填充数据库 306

5.5 Query Execution / 执行查询 310

5.5.1 Prepared Statements / 预备语句 311

5.5.2 Reading and Writing LOBs / 读写LOB 317

5.5.3 SQL Escapes / SQL转义 319

5.5.4 Multiple Results / 多结果集 321

5.5.5 Retrieving Autogenerated Keys / 获取自动生成的主键 322

5.6 Scrollable and Updatable Result Sets / 可滚动和可更新的结果集 322

5.6.1 Scrollable Result Sets / 可滚动的结果集 323

5.6.2 Updatable Result Sets / 可更新的结果集 325

5.7 Row Sets / 行集 329

5.7.1 Constructing Row Sets / 构建行集 330

5.7.2 Cached Row Sets / 缓存的行集 330

5.8 Metadata / 元数据 334

5.9 Transactions / 事务 344

5.9.1 Programming Transactions with JDBC / 使用JDBC编程实现事务 344

5.9.2 Save Points / 保存点 345

5.9.3 Batch Updates / 批量更新 345

5.9.4 Advanced SQL Types / 高级SQL类型 348

5.10 Connection Management in Web and Enterprise Applications / Web与企业应用中的连接管理 349



Chapter 6: The Date and Time API / 日期与时间API 353

6.1 The Time Line / 时间线 354

6.2 Local Dates / 本地日期 358

6.3 Date Adjusters / 日期调整 364

6.4 Local Time / 本地时间 365

6.5 Zoned Time / 时区时间 367

6.6 Formatting and Parsing / 格式化与解析 371

6.7 Interoperating with Legacy Code / 与遗留代码互操作 376



Chapter 7: Internationalization / 国际化 379

7.1 Locales / 地域 380

7.1.1 Why Locales / 为什么要引入地域类 380

7.1.2 Specifying Locales / 指定地域 381

7.1.3 The Default Locale / 默认地域 384

7.1.4 Display Names / 显示地域名 384

7.2 Number Formats / 数字格式 387

7.2.1 Formatting Numeric Values / 格式化数字值 387

7.2.2 Currencies / 货币 393

7.3 Date and Time / 日期与时间 394

7.4 Collation and Normalization / 排序规则与标准化 402

7.5 Message Formatting / 消息格式化 409

7.5.1 Formatting Numbers and Dates / 格式化数字和日期 409

7.5.2 Choice Formats / choice格式化选项 411

7.6 Text Input and Output / 文本输入与输出 413

7.6.1 Text Files / 文本文件 414

7.6.2 Line Endings / 文本行结尾符号 414

7.6.3 The Console / 控制台 414

7.6.4 Log Files / 日志文件 415

7.6.5 The UTF-8 Byte Order Mark / UTF-8字节顺序标记 415

7.6.6 Character Encoding of Source Files / 源文件的字符编码 416

7.7 Resource Bundles / 资源包 417

7.7.1 Locating Resource Bundles / 定位资源包 417

7.7.2 Property Files / 属性文件 418

7.7.3 Bundle Classes / 包类 419

7.8 A Complete Example / 完整示例 421



Chapter 8: Scripting, Compiling, and Annotation Processing / 脚本、编译与注解处理 439

8.1 Scripting for the Java Platform / Java平台的脚本 440

8.1.1 Getting a Scripting Engine / 获得脚本引擎 440

8.1.2 Script Evaluation and Bindings / 脚本求值与绑定 441

8.1.3 Redirecting Input and Output / 重定向输入输出 444

8.1.4 Calling Scripting Functions and Methods / 调用脚本函数和方法 444

8.1.5 Compiling a Script / 编译脚本 446

8.1.6 An Example: Scripting GUI Events / 示例:用脚本处理GUI事件 447

8.2 The Compiler API / 编译器API 452

8.2.1 Invoking the Compiler / 调用编译器 453

8.2.2 Launching a Compilation Task / 启动编译任务 453

8.2.3 Capturing Diagnostics / 捕获诊断信息 454

8.2.4 Reading Source Files from Memory / 从内存读取源文件 454

8.2.5 Writing Byte Codes to Memory / 将字节码写入内存 455

8.2.6 An Example: Dynamic Java Code Generation / 示例:动态Java代码生成 457

8.3 Using Annotations / 使用注解 463

8.3.1 An Introduction into Annotations / 注解简介 464

8.3.2 An Example: Annotating Event Handlers / 示例:注解事件处理程序 465

8.4 Annotation Syntax / 注解语法 471

8.4.1 Annotation Interfaces / 注解接口 471

8.4.2 Annotations / 注解 473

8.4.3 Annotating Declarations / 在声明的地方使用注解 475

8.4.4 Annotating Type Uses / 在类型使用的地方使用注解 476

8.4.5 Annotating this / 对this做注解 477

8.5 Standard Annotations / 标准注解 478

8.5.1 Annotations for Compilation / 用于编译的注解 480

8.5.2 Annotations for Managing Resources / 用于管理资源的注解 480

8.5.3 Meta-Annotations / 元注解 481

8.6 Source-Level Annotation Processing / 源码级注解处理 484

8.6.1 Annotation Processors / 注解处理器 484

8.6.2 The Language Model API / 语言模型API 485

8.6.3 Using Annotations to Generate Source Code / 使用注解生成源代码 486

8.7 Bytecode Engineering / 字节码工程 489

8.7.1 Modifying Class Files / 修改类文件 490

8.7.2 Modifying Bytecodes at Load Time / 在加载时修改字节码 495



Chapter 9: The Java Platform Module System / Java平台模块系统 499

9.1 The Module Concept / 模块概念 500

9.2 Naming Modules / 命名模块 501

9.3 The Modular“Hello, World!”Program / 模块化的“Hello, World!”程序 502

9.4 Requiring Modules / 请求模块 504

9.5 Exporting Packages / 导出包 506

9.6 Modular JARs / 模块化的JAR文件 510

9.7 Modules and Reflective Access / 模块与反射访问 511

9.8 Automatic Modules / 自动模块 515

9.9 The Unnamed Module / 未命名模块 517

9.10 Command-Line Flags for Migration / 用于迁移的命令行标志 518

9.11 Transitive and Static Requirements / 传递和静态请求 519

9.12 Qualified Exporting and Opening / 限制导出和打开 521

9.13 Service Loading / 服务加载 522

9.14 Tools for Working with Modules / 处理模块的工具 524



Chapter 10: Security / 安全 529

10.1 Class Loaders / 类加载器 530

10.1.1 The Class-Loading Process / 类加载流程 530

10.1.2 The Class Loader Hierarchy / 类加载器层次结构 532

10.1.3 Using Class Loaders as Namespaces / 将类加载器作为命名空间 534

10.1.4 Writing Your Own Class Loader / 编写自己的类加载器 534

10.1.5 Bytecode Verification / 字节码验证 541

10.2 Security Managers and Permissions / 安全管理器与权限 546

10.2.1 Permission Checking / 权限检查 546

10.2.2 Java Platform Security / Java平台安全 547

10.2.3 Security Policy Files / 安全策略文件 551

10.2.4 Custom Permissions / 定制权限 559

10.2.5 Implementation of a Permission Class / 实现权限类 560

10.3 User Authentication / 用户认证 566

10.3.1 The JAAS Framework / JAAS框架 566

10.3.2 JAAS Login Modules / JAAS登录模块 573

10.4 Digital Signatures / 数字签名 582

10.4.1 Message Digests / 消息摘要 583

10.4.2 Message Signing / 消息签名 587

10.4.3 Verifying a Signature / 验证签名 589

10.4.4 The Authentication Problem / 认证问题 592

10.4.5 Certificate Signing / 证书签名 594

10.4.6 Certificate Requests / 证书请求 596

10.4.7 Code Signing / 代码签名 597

10.5 Encryption / 加密 599

10.5.1 Symmetric Ciphers / 对称密码 600

10.5.2 Key Generation / 生成密钥 602

10.5.3 Cipher Streams / 加密流 607

10.5.4 Public Key Ciphers / 公钥密码 608



Chapter 11: Advanced Swing and Graphics / 高级Swing和图形编程 613

11.1 Tables / 表格 613

11.1.1 A Simple Table / 简单表格 614

11.1.2 Table Models / 表格模式 618

11.1.3 Working with Rows and Columns / 行列操作 622

11.1.3.1 Column Classes / 列类 622

11.1.3.2 Accessing Table Columns / 访问表列 623

11.1.3.3 Resizing Columns / 调整列 624

11.1.3.4 Resizing Rows / 调整行 625

11.1.3.5 Selecting Rows, Columns, and Cells / 选择行、列和单元格 626

11.1.3.6 Sorting Rows / 对行进行排序 627

11.1.3.7 Filtering Rows / 对行进行过滤 628

11.1.3.8 Hiding and Displaying Columns / 隐藏或显示列 630

11.1.4 Cell Rendering and Editing / 单元格的绘制和编辑 639

11.1.4.1 Rendering Cells / 绘制单元格 639

11.1.4.2 Rendering the Header / 绘制表头 641

11.1.4.3 Editing Cells / 编辑单元格 641

11.1.4.4 Custom Editors / 定制编辑器 642

11.2 Trees / 树 652

11.2.1 Simple Trees / 简单的树 654

11.2.2 Node Enumeration / 节点枚举 672

11.2.3 Rendering Nodes / 渲染节点 674

11.2.4 Listening to Tree Events / 监听树事件 677

11.2.5 Custom Tree Models / 定制树模型 684

11.3 Advanced AWT / 高级AWT 693

11.3.1 The Rendering Pipeline / 绘制图形的流程 694

11.3.2 Shapes / 形状 696

11.3.2.1 The Shape Class Hierarchy / Shape类层次结构 697

11.3.2.2 Using the Shape Classes / 使用各种Shape类 698

11.3.3 Areas / 区域 714

11.3.4 Strokes / 画笔 715

11.3.5 Paint / 着色 724

11.3.6 Coordinate Transformations / 坐标变换 727

11.3.7 Clipping / 剪切 733

11.3.8 Transparency and Composition / 透明和组合 735

11.4 Raster Images / 光栅图像 744

11.4.1 Readers and Writers for Images / 图像的读取器和写入器 745

11.4.1.1 Obtaining Readers and Writers for Image File Types / 获取图像文件类型的读取器和写入器 745

11.4.1.2 Reading and Writing Files with Multiple Images / 读写包含多个图像的文件 747

11.4.2 Image Manipulation / 图像处理 756

11.4.2.1 Constructing Raster Images / 构建光栅图像 756

11.4.2.2 Filtering Images / 图像过滤 763

11.5 Printing / 打印 772

11.5.1 Graphics Printing / 图形打印 772

11.5.2 Multiple-Page Printing / 多页打印 782

11.5.3 Print Services / 打印服务 792

11.5.4 Stream Print Services / 流打印服务 796

11.5.5 Printing Attributes / 打印属性 799



Chapter 12: Native Methods / 本地方法 809

12.1 Calling a C Function from a Java Program / 从Java程序中调用C函数 810

12.2 Numeric Parameters and Return Values / 数值参数与返回值 817

12.3 String Parameters / 字符串参数 819

12.4 Accessing Fields / 访问字段 825

12.4.1 Accessing Instance Fields / 访问实例字段 825

12.4.2 Accessing Static Fields / 访问静态字段 829

12.5 Encoding Signatures / 编码签名 831

12.6 Calling Java Methods / 调用Java方法 832

12.6.1 Instance Methods / 实例方法 833

12.6.2 Static Methods / 静态方法 834

12.6.3 Constructors / 构造器 835

12.6.4 Alternative Method Invocations / 其他调用方法的手段 835

12.7 Accessing Array Elements / 访问数组元素 840

12.8 Handling Errors / 处理错误 844

12.9 Using the Invocation API / 使用Invocation API 849

12.10 A Complete Example: Accessing the Windows Registry / 完整示例:访问Windows注册表 855

12.10.1 Overview of the Windows Registry / Windows注册表简介 855

12.10.2 A Java Platform Interface for Accessing the Registry / 访问注册表的Java平台接口 856

12.10.3 Implementation of Registry Access Functions as Native Methods / 以本地方法方式实现注册表访问功能 857

Java核心技术 卷II:高级特性 第11版·英文版 上下册 pdf下载声明

本pdf资料下载仅供个人学习和研究使用,不能用于商业用途,请在下载后24小时内删除。如果喜欢,请购买正版

pdf下载地址

版权归出版社和作者所有,下载链接已删除。如果喜欢,请购买正版!

链接地址:Java核心技术 卷II:高级特性 第11版·英文版 上下册