2008年5月24日 星期六

private & protected methods

private method:
(1) use private  with argument
ex:
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


沒有留言: