encapsolution
#
encapsolution
含有「encapsolution」關鍵字的內容
全部共 1 篇文章
排序:發佈日期新到舊
封裝:public / private / protected
public: 完全公開的方法,內外皆可存取。 private: 對外限制,不能有特定的receiver,故僅能在類別方法裡使用,且不能有receiver。 protected : 對外有限制,不能有receiver,但在class裡面則可有receiver也可以沒有receiver。
Mike
2
閱讀時間約
2
分鐘
#
Ruby
#
#
#
#
#
#
#
#
#