Next to a mouse, even a goose is enormous. But next to a dragon... In this task, we have geese (Goose class) and dragons (Dragon class). As well as their ancestors, BigAnimal and SmallAnimal classes. Guess for yourself whose ancestor is whose. Then override the String getSize() method for Goose and Dragon so that they display strings about the animal's size.
OOP: Animal inheritance
You must be signed in to leave a comment
1 October 2018, 18:56
There seems to be a typo here: 5. In the Goose class, the getSize method must be overridden. It should return a string formatted as follows: "A goose is small," + .getSize(). 6. In the Dragon class, the getSize method must be overridden. It should return a string formatted as follows: "A dragon is big," + .getSize().
2 October 2018, 16:52
Yes, there is. It only passed when you give a space between comma and ". Like this -
18 February 2020, 15:02
Yes, the typo is still here in February 2020... Got 1 failed attempt because of it
Alex Vypirailenko Java Developer at Toshiba Global Comme
19 February 2020, 08:19
There's a clear space between the comma and the quote mark:
4 March, 05:49
See rather big red arrow )