- 3 -
6.9 finally 块 ................................................................................. 111
6.10 Java 的内置异常 ........................................................................ 112
6.11 创建自己的异常子类 .................................................................. 113
6.12 断言 ........................................................................................... 115
7 多线程编程 ............................................................................................. 117
7.1 线程的概念 ................................................................................ 117
7.2 Java 线程模型 ............................................................................ 117
Thread 类和 Runnable 接口 ...................................................................... 118
7.3 主线程 ....................................................................................... 119
7.4 创建线程 .................................................................................... 120
7.5 创建多线程 ................................................................................ 122
7.6 isAlive()和 join()的使用 ........................................................ 123
7.7 线程优先级 ................................................................................ 124
7.8 线程同步 .................................................................................... 126
7.9 线程间通信 ................................................................................ 128
7.10 线程死锁 .................................................................................... 130
7.11 线程的挂起、恢复和终止 ........................................................... 131
Java 1.1 或更早版本的线程的挂起、恢复和终止 .......................................... 132
Java 2 中挂起、恢复和终止线程 ................................................................... 133
8 输入输出(IO)操作 ................................................................................... 135
8.1 输入输出基本概念 ..................................................................... 135
8.2 面向字符的输入流 ..................................................................... 136
8.3 面向字符的输出流 ..................................................................... 138
8.4 面向字节的输入输出流 .............................................................. 140
8.5 面向字节流的应用 ..................................................................... 142
8.6 文件与目录管理 ......................................................................... 144
8.7 文件的随机读写 ......................................................................... 146
8.8 文件的压缩处理 ......................................................................... 147
9 常用类库、向量与哈希 ........................................................................... 149
9.1 Java 基础类库 ............................................................................ 149
9.2 Object 类 ................................................................................... 149
1. obj1.equals(obj2); .................................................................................. 149
9.3 Java 语言包(java.lang)简介 .................................................... 150
9.4 日期和时间类 ............................................................................. 153
9.5 向量及其应用 ............................................................................. 155
9.6 哈希表及其应用 ......................................................................... 157
10 图形界面(GUI)设计 .......................................................................... 159
10.1 图形界面设计基础 ..................................................................... 159
10.2 框架窗口 .................................................................................... 161
10.3 标签、按钮和按钮事件 .............................................................. 163
10.4 面板 ........................................................................................... 165
10.5 布局设计 .................................................................................... 167
10.6 文本框和文本区 ......................................................................... 168
10.7 文本框和文本区的输入输出 ....................................................... 170