publicclass:Ruby 的 class 中的 private、 protected、public

Private private 只能 在本类和子类 上下文中且只能通过self访问 这个意思就是:private只能在本对象内部访问到 对象例子变量(@)访问权限就是 private er" _disibledevent=复制代码 代码如下: AccessTest def test “test private” end def test_other(other) “other object ... [阅读全文]
1 共1条 分1页