Course of Raku / Objects, I/O, and exceptions / Classes and objects / Inheritance / Overriding methods
Quiz — Inheritance
What does the following program print?
class Animal {
method speak { 'some sound' }
}
class Cow is Animal {
method speak { 'Moo' }
}
say Cow.new.speak;| 0 | some sound |
| 1 | Moo |
| 0 | Animal |
| 0 | an error |