super
class Person
def initialize(name)
@name = name
end
def name
return @name
end
end
class Doctor < Person
def name
“Dr. “ + super
end
end
That, in short, is how super works.
I am scribbling.
0 Comments:
Post a Comment
<< Home