private method:
(1) use private with argumentex:
private :test, :run
(2) use private
ex:
private
def test
end
def run
end
the methods after private are private
protected method:
use protected
can call the object's protected method as long as self is an instance of the same class as the object whose protected method is called
沒有留言:
張貼留言