Introduction to OOP | Chapter 16: Overriding : | next | previous | audio | real | text |
"class Number" sqrt ^ self asFloat sqrtThe method in class Float clearly must perform something different, in this case actually computing the square root. The parent class has a method that will work in most, but not all, child classes.