Ruby - Inheritance
What will be the output of this Ruby code?
class Animal
protected
def sound
"growl"
end
def call_sound(other)
other.sound
end
end
lion = Animal.new
wolf = Animal.new
puts lion.call_sound(wolf)