一、开发工具
开发工具: Eclipse(免费)
1.1 Eclipse安装
Eclipse直接解压即可使用
![](https://img-blog.csdnimg.cn/img_convert/a9ff6c2dbd545924a156ee36452743a4.png)
![](https://img-blog.csdnimg.cn/img_convert/e87b18c7c633f35b40b2aeab0440a719.png)
ps: 如果双击启动Eclipse失败,大部分原因都是jdk环境变量没有配置正确,重新检查即可!
![](https://img-blog.csdnimg.cn/img_convert/3ba9c2ed94f91879095b082552051bb5.png)
1.2Eclipse界面介绍
![](https://img-blog.csdnimg.cn/img_convert/304e997e07e2daa29f6121f17d53ca4f.png)
二、Eclipse使用
2.1 创建项目
项目就是为了统一管理代码的一个文件夹.
在项目列表区域右键new-->project-->java project
![](https://img-blog.csdnimg.cn/img_convert/eb4d7da685d604b76fbec777f99124b0.png)
![](https://img-blog.csdnimg.cn/img_convert/e60b5dc4745f2c9bfcf1afc4a5e18e00.png)
![](https://img-blog.csdnimg.cn/img_convert/09ff1474ea4ac8da0e98de81f8a1ee53.png)
![](https://img-blog.csdnimg.cn/img_convert/64e333d9efe82d9d231c9e659b85f266.png)
2.2 创建包结构
选中src-->右键-->new-->package
![](https://img-blog.csdnimg.cn/img_convert/8282837b1c220f4d65d47c8cb7bc26c7.png)
![](https://img-blog.csdnimg.cn/img_convert/f0b98a22c4802e108faeebcc51cafcab.png)
2.3 创建类
选中包右键-->new--> class
![](https://img-blog.csdnimg.cn/img_convert/223d342d7914d4e3cbccc364f390f609.png)
![](https://img-blog.csdnimg.cn/img_convert/599371b1132bdc2fe6f1a9c73ff74d82.png)
在类中写代码
![](https://img-blog.csdnimg.cn/img_convert/4d10dc89e4edd7e41e35f3c9a121101f.png)
右键找Run As运行
![](https://img-blog.csdnimg.cn/img_convert/fe8dbc44f1c445819eac167e767a6bae.png)
得到结果
![](https://img-blog.csdnimg.cn/img_convert/cb44a2c426cc92e859a175d90605e188.png)
三、注释的使用
- 单行注释 //
![](https://img-blog.csdnimg.cn/img_convert/575c60a55b84b5aca7831439f9c935cf.png)
2、多行注释 /* 在里面填写 */
![](https://img-blog.csdnimg.cn/img_convert/90ab8d6550ba183db39f192a7f21f127.png)
3、文档注释 /** 在里面填写 */
指到类名可以显示
![](https://img-blog.csdnimg.cn/img_convert/9b014c998b811d2c1d77d04d10c9f5ba.png)
四、快捷键
例如:输入‘’syso‘’ 按alt+/ 快速生成输出语句System.out.println();
*1.补全代码的声明:alt + /
* 2.快速修复: ctrl + 1
* 3.批量导包:ctrl + shift + o
* 4.使用单行注释:ctrl + /
* 5.使用多行注释: ctrl + shift + /
* 6.取消多行注释:ctrl + shift + \
* 7.复制指定行的代码:ctrl + alt + down 或 ctrl + alt + up
* 8.删除指定行的代码:ctrl + d
* 9.上下移动代码:alt + up 或 alt + down
* 10.切换到下一行代码空位:shift + enter
* 11.切换到上一行代码空位:ctrl + shift + enter
* 12.如何查看源码:ctrl + 选中指定的结构 或 ctrl + shift + t
* 13.退回到前一个编辑的页面:alt + left
* 14.进入到下一个编辑的页面(针对于上面那条来说的):alt + right
* 15.光标选中指定的类,查看继承树结构:ctrl + t
* 16.复制代码: ctrl + c
* 17.撤销: ctrl + z
* 18.反撤销: ctrl + y
* 19.剪切:ctrl + x
* 20.粘贴:ctrl + v
* 21.保存: ctrl + s
* 22.全选:ctrl + a
* 23.格式化代码: ctrl + shift + f
* 24.选中数行,整体往后移动:tab
* 25.选中数行,整体往前移动:shift + tab
* 26.在当前类中,显示类结构,并支持搜索指定的方法、属性等:ctrl + o
* 27.批量修改指定的变量名、方法名、类名等:alt + shift + r
* 28.选中的结构的大小写的切换:变成大写: ctrl + shift + x
* 29.选中的结构的大小写的切换:变成小写:ctrl + shift + y
* 30.调出生成 getter/setter/构造器等结构: alt + shift + s
* 31.显示当前选择资源(工程 or 文件)的属性:alt + enter
* 32.快速查找:参照选中的 Word 快速定位到下一个 :ctrl + k
* 33.关闭当前窗口:ctrl + w
* 34.关闭所有的窗口:ctrl + shift + w
* 35.查看指定的结构使用过的地方:ctrl + alt + g
* 36.查找与替换:ctrl + f
* 37.最大化当前的 View:ctrl + m
* 38.直接定位到当前行的首位:home
* 39.直接定位到当前行的末位:end