Board logo

標題: 這個結構class內有class有沒有違反OOP conecpte???? [打印本頁]

作者: student_abc    時間: 2015-12-26 18:25     標題: 這個結構class內有class有沒有違反OOP conecpte????

本帖最後由 student_abc 於 2015-12-26 18:52 編輯

Does the structure violate OO conecpte?????  
public  class MainActivity{

    public void showMessage(){
          Printer obj=new Printer();
          ......
    }
    private class Printer(){
         .....   
    }
}
作者: tsangwailam    時間: 2015-12-26 20:15

本帖最後由 tsangwailam 於 2015-12-26 20:18 編輯

冇,valid。
有啲language 用離做private class,用離define 啲class 只係用返衣個俾包住佢個個class用。
作者: KinChungE    時間: 2015-12-26 20:42

inner class係好common既野
點會violate
作者: student_abc    時間: 2015-12-26 21:16

inner class係好common既野
點會violate
KinChungE 發表於 2015-12-26 20:42



    You are so nice. thank you!
作者: DarkHero    時間: 2015-12-26 23:06

You are so nice. thank you!
student_abc 發表於 2015-12-26 21:16


inner class build 出黎都係普通class





歡迎光臨 電腦領域 HKEPC Hardware (https://h0.hkepc.com/forum/) Powered by Discuz! 7.2