5月3日上課筆記-properties檔案,junit測試,mvc封層等

來源:互聯網
上載者:User

標籤:info   建立   div   匯入   配置   package   載入   類載入   中間   

 StringBuffer    安全執行緒,效率低 StringBuilder    線程不安全,效率高 判斷數組是null還是空數組    null    空數組    int[]  array=null;    int[]  array2= new int[]{};    建立幾個對象?        String s=new String("關羽");        建立了兩個對象     1.*讀取properties設定檔        dbinfo.properties        a.反射的類載入器讀取設定檔            反射:                將類的各種成分映射成相應的類        b.工具類ResourceBundle            ResourceBundle bundle = ResourceBundle.getBundle("cn/test/dbinfo");//傳入檔案名稱,不需要尾碼            String age = bundle.getString("age");            System.out.println(age);      2.單元測試junit    junit4        單元測試的方法傳回型別必須是void        添加註解            @Test        匯入junit4        斷言:            實際結果是否匹配預期結果                Assert.assertEquals(預期的結果,實際結果)  3.MVC分層     M----Model(模型層)        一般指javaBean    V----View(視圖層)        在web階段指頁面,在U1一般指控制台    C----Controller(控制層)        就是將使用者請求轉寄給模型層,        經過處理後把結果返回到介面層展現的一個中介層    項目中分Package        M--- bean pojo domain            V----存放頁面        C:            dao      資料操作                daoImpl            service  商務邏輯                serviceImpl                cn.bdqn.pojo         cn.bdqn.dao        cn.bdqn.dao.impl        cn.bdqn.service        cn.bdqn.service.impl        cn.bdqn.test    

 

5月3日上課筆記-properties檔案,junit測試,mvc封層等

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.