1.實驗要求html
參考 http://www.cnblogs.com/rocedu/p/6371315.html#SECCODESTANDARD 安裝alibaba 插件,解決代碼中的規範問題。git
public class CodeStandard { public static void main(String [] args){ StringBuffer buffer = new StringBuffer(); buffer.append('S'); buffer.append("tringBuffer"); System.out.println(buffer.charAt(1)); System.out.println(buffer.capacity()); System.out.println(buffer.indexOf("tring")); System.out.println("buffer = " + buffer.toString()); if(buffer.capacity()<20) buffer.append("1234567"); for(int i=0; i<buffer.length();i++) System.out.println(buffer.charAt(i)); } }
2.格式化後編程
public class CodeStandard { public static void main(String [] args){ StringBuffer buffer = new StringBuffer(); buffer.append('S'); buffer.append("tringBuffer"); System.out.println(buffer.charAt(1)); System.out.println(buffer.capacity()); System.out.println(buffer.indexOf("tring")); System.out.println("buffer = " + buffer.toString()); if(buffer.capacity()<20) { buffer.append("1234567"); } for(int i=0; i<buffer.length();i++) { System.out.println(buffer.charAt(i)); } } }
3.截圖app
1.實驗要求工具
2.測試成功截圖單元測試
3.上傳到搭檔碼雲,git log日誌學習
1.實驗要求測試
2.關於重構插件
3.重構前3d
4.重構後
1.實驗要求
提交學習成果碼雲連接和表明性成果截圖,要有學號水印。
2.截圖
經過此次實驗我瞭解瞭如何對代碼進行格式化和重構,使代碼更有可讀性,更整潔。是一項對於編程很是有用的技能