eclipse常用快捷键 数组创建 冒泡排序
2016-10-13 20:06
169 查看
Eclipse:
Src:source :源代码
包名创建规则:所有包名要求小写 com:公司org:教育
Jre:java类库
Eclipse常用快捷键:
Ctrl+1:快速修复
Ctrl+Shift+F:格式化代码
Ctrl+Shift+o:导包
Alt+/:内容辅助 自动补全
Ctrl+/ 注释当前行,再按则取消注释
Ctrl+D:删除行
Ctrl+Alt+↓ 复制当前行到下一行(复制增加)
Ctrl+Alt+↑ 复制当前行到上一行(复制增加)
Alt+←前一个编辑的页面
Alt+→下一个编辑的页面
Ctrl+H 打开搜索对话框
Ctrl+F 在当前类中搜索
数组创建方式:
1. int arr[]=new int[5];
2. int arr[]=new int[]{1,4,5,4,2,1};
3. int arr[]={1,4,5,4,2,1};
异常:
Exception in thread “main”java.lang.ArrayIndexOutOfBoundsException
//数组越界
加强for循环:
For(int x:数组|集合){} //黄色为定义的变量类型 由:后面的数据源决定
一旦某个方法有返回值,必须要在调用它的地方申明变量接收,否则没意义。
内存分类:
1. 寄存器
2. 方法区
3. Java栈区 存放变量
4. 本地栈区
5. 堆存放new对象不容易被GC回收
数组默认值:
String 默认nulldouble和float默认0.0
产生任意整数:(int )(Math.random()*(大-小+1)+小)
数组元素去重:
for (int i = 0; i < arr.length; i++) {
arr = (int) (Math.random() * 100 + 1);
//不重复
for(int j = 0; j < i; j++) {
if(arr[j] == arr) {
i–;
break;
}
}
}
冒泡排序:
for (int i =0; i < arr.length; i++) {
for (int j = 0; j < arr.length-i-1;j++) {-}
注意:-1:表示元素两两比较即不能出现自己和自己比较的情况–i:每次比较抛掉已经遍历排好序的元素由后往前
Src:source :源代码
包名创建规则:所有包名要求小写 com:公司org:教育
Jre:java类库
Eclipse常用快捷键:
Ctrl+1:快速修复
Ctrl+Shift+F:格式化代码
Ctrl+Shift+o:导包
Alt+/:内容辅助 自动补全
Ctrl+/ 注释当前行,再按则取消注释
Ctrl+D:删除行
Ctrl+Alt+↓ 复制当前行到下一行(复制增加)
Ctrl+Alt+↑ 复制当前行到上一行(复制增加)
Alt+←前一个编辑的页面
Alt+→下一个编辑的页面
Ctrl+H 打开搜索对话框
Ctrl+F 在当前类中搜索
数组创建方式:
1. int arr[]=new int[5];
2. int arr[]=new int[]{1,4,5,4,2,1};
3. int arr[]={1,4,5,4,2,1};
异常:
Exception in thread “main”java.lang.ArrayIndexOutOfBoundsException
//数组越界
加强for循环:
For(int x:数组|集合){} //黄色为定义的变量类型 由:后面的数据源决定
一旦某个方法有返回值,必须要在调用它的地方申明变量接收,否则没意义。
内存分类:
1. 寄存器
2. 方法区
3. Java栈区 存放变量
4. 本地栈区
5. 堆存放new对象不容易被GC回收
数组默认值:
String 默认nulldouble和float默认0.0
产生任意整数:(int )(Math.random()*(大-小+1)+小)
数组元素去重:
for (int i = 0; i < arr.length; i++) {
arr = (int) (Math.random() * 100 + 1);
//不重复
for(int j = 0; j < i; j++) {
if(arr[j] == arr) {
i–;
break;
}
}
}
冒泡排序:
for (int i =0; i < arr.length; i++) {
for (int j = 0; j < arr.length-i-1;j++) {-}
注意:-1:表示元素两两比较即不能出现自己和自己比较的情况–i:每次比较抛掉已经遍历排好序的元素由后往前
相关文章推荐
- eclipse常用快捷键
- Eclipse 常用快捷键收集(中文)
- Eclipse常用快捷键
- Eclipse常用快捷键
- Eclipse常用快捷键
- eclipse常用快捷键及使用技巧
- Eclipse下常用快捷键
- Eclipse:常用快捷键
- Eclipse常用快捷键
- Eclipse 常用快捷键
- Eclipse常用快捷键和插件
- Eclipse常用快捷键
- Eclipse常用快捷键及启动参数设置
- Eclipse开发经典教程:常用快捷键
- Eclipse中编写Code的常用快捷方式
- Eclipse中编写Code的常用快捷方式
- Eclipse经典常用快捷键
- eclipse常用快捷键
- Eclipse的常用快捷键
- (转)eclipse常用快捷方式