前 言
第1章 开始Java之旅 ··································1
1.1 无处不在的Java ············································1
1.2 Java为何受大家喜爱 ············································2
1.3 Java的目标 ········································3
1.4 Java开发环境的搭建 ············································3
1.4.1 JDK的下载与安装 ···································3
1.4.2 Java开发环境配置 ···································5
1.5 Java程序运行的原理 ············································6
1.6 Java开发工具Eclipse ···········································6
1.6.1 Eclipse的安装与启动 ···········································6
1.6.2 Eclipse编写Java程序的流程·········································8
1.7 要点总结 ··········································12
1.8 练习题 ··············································12
第2章 Java语言基础 ·····················13
2.1 Java程序的基本组成 ··········································13
2.2 Java语言的数据类型 ··········································16
2.2.1 整数类型 ·················································16
2.2.2 浮点类型 ·················································17
2.2.3 字符类型 ·················································17
2.2.4 布尔类型 ·················································17
2.2.5 基本数据类型的默认值 ···········································17
2.2.6 类型转换 ·················································17
2.3 运算符和表达式 ··············································19
2.3.1 赋值运算符 ·············································19
2.3.2 算术运算符 ·············································19
2.3.3 位运算符 ·················································20
2.3.4 关系运算符 ·············································21
2.3.5 三元运算符 ·············································21
2.3.6 运算符优先级 ·········································22
2.4 流程控制语句 ··································22
2.4.1 选择语句 ·················································22
2.4.2 循环语句 ·················································27
2.5 数组与方法 ······································32
2.5.1 一维数组 ·················································32
2.5.2 二维数组 ·················································35
2.5.3 方法 ·····································37
2.6 要点总结 ··········································40
2.7 编程练习 ········································