14 STL-常用演算法
阿新 • • 發佈:2022-11-30
執行(run) alt + r
提示補全 (Class Name Completion) alt + /
單行註釋 ctrl + /
多行註釋 ctrl + shift + /
向下複製一行 (Duplicate Lines) ctrl + alt + down
刪除一行或選中行 (delete line) ctrl + d
向下移動行(move statement down) alt + down
向上移動行(move statement up) alt + up
向下開始新的一行(start new line) shift + enter
向上開始新的一行 (Start New Line before current) ctrl + shift + enter
如何檢視原始碼
(class) ctrl + 選中指定的結構 或 ctrl + shift + t
萬能解錯/生成返回值變數
alt + enter
退回到前一個編輯的頁面
(back) alt + left
進入到下一個編輯的頁面(針對於上條)
(forward) alt + right
檢視繼承關係
(type hierarchy) F4
格式化程式碼
(reformat code) ctrl + shift + F
提示方法引數型別
(Parameter Info) ctrl + alt + /
複製程式碼
ctrl + c
撤銷
ctrl + z
反撤銷
ctrl + y
剪下
ctrl + x
貼上
ctrl + v
儲存
ctrl + s
全選
ctrl + a
選中數行,整體往後移動
tab
選中數行,整體往前移動
shift + tab
檢視類的結構:類似於 eclipse 的
outline ctrl + o
重構:修改變數名與方法名(rename)
alt + shift + r
大寫轉小寫/小寫轉大寫(toggle case)
ctrl + shift + y
生成構造器 /get/set/toString
alt + shift + s
檢視文件說明(quick documentation)
F2
收起所有的方法(collapse all)
alt + shift + c
開啟所有方法(expand all)
alt + shift + x
開啟程式碼所在硬碟資料夾(show in explorer)
ctrl + shift + x
生成 try-catch 等(surround with)
alt + shift + z
區域性變數抽取為成員變數(introduce field)
alt + shift + f
查詢/替換(當前)
ctrl + f
查詢(全域性)
ctrl + h
查詢檔案
double Shift
檢視類的繼承結構圖(Show UML Diagram)
ctrl + shift + u
檢視方法的多層重寫結構(method hierarchy)
ctrl + alt + h
新增到收藏(add to favorites)
ctrl + alt + f
抽取方法(Extract Method)
alt + shift + m
開啟最近修改的檔案(Recently Files)
ctrl + E
關閉當前開啟的程式碼欄(close)
ctrl + w
關閉開啟的所有程式碼欄(close all)
ctrl + shift + w
快速搜尋類中的錯誤(next highlighted error)
ctrl + shift + q
選擇要貼上的內容(Show in Explorer)
ctrl + shift + v
查詢方法在哪裡被呼叫(Call Hierarchy)
ctrl + shift + h
程式碼快捷鍵
psvm
: 可生成 main 方法sout
: System.out.println() 快捷輸出類似的:
soutp
=> System.out.println("方法形參名 = " + 形參名);soutv
=> System.out.println("變數名 = " + 變數);soutm
=> System.out.println(“當前類名.當前方法”);“abc”.sout
=> System.out.println(“abc”);
fori
: 可生成 for 迴圈
類似的:iter
:可生成增強 for 迴圈itar
:可生成普通 for 迴圈
list.for
: 可生成集合 list 的 for 迴圈
例如:List list = new ArrayList();
輸入: list.for 即可輸出
for(String s:list){
}
又如:list.fori 或 list.forr
ifn
:可生成 if(xxx = null):
inn
:可生成 if(xxx != null) 或 xxx.nn 或 xxx.null
prsf
:可生成 private static final
psf
:可生成 public static final
psfi
:可生成 public static final int
psfs
:可生成 public static final String