常用Idea快捷鍵
- ctrl+shift+alt: 多行操作
- psvm: 生成main()方法
- fori: 生成for循環;
- ctrl+alt+v:自動補齊返回值類型
- ctrl+0:覆寫方法
- ctrl+i:實現接口中的方法
- ctrl+shift+u:大小寫轉換
- ctrl+shift+z:取消撤銷
- alt+insert:生成構造方法,getter,setter
- ctrl+y:刪除當前行
- ctrl+shift+j:將選中的行合並成一行
- ctrl+g:定位到某一行
- ctrl+shift+上箭頭:將光標所在代碼塊向上整體移動
- ctrl+shift+下箭頭:將光標所在代碼塊向下整體移動
- alt+shift+向上箭頭:將行向上移動
- alt+shift+向下箭頭:將行向下移動
- ctrl+f:在當前文件中查找
- ctrl+r:替換字符串
- ctrl+shift+f:在全局文件中查找字符串
- ctrl+shift+r:在全局中替換字符串
- ctrl+shift+enter:自動補齊{}或者分號;
- shift+enter:在當前行的下方開始新行
- ctrl+alt+enter:在當前行的上方插入新行
- ctrl+delete:刪除光
scanner
java Scanner 用法
Scanner a=new Scanner(System.in);
while(a.hasnext()){
String s=a.hasnext();
System.out.println(s);
}
/*遇到空格的話Scanner.next是無法讀取空格后面的數據的*/
但Scanner.nextLine可以:
Scanner a=new Scanner(System.in);
while(a.hasnextLine()){
String S=a.hasnextLine();
System.out.println(S.nextLine());
}