OOP: Animal inheritance

  • 4
  • Locked
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.
You can't complete this task, because you're not signed in.
Comments (5)
  • Popular
  • New
  • Old
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().
Ankush Rajput
Level 25 , Bhopal, India
2 October 2018, 16:52
Yes, there is. It only passed when you give a space between comma and ". Like this -
"A goose is small, " + super.getSize().
Pandora
Level 17 , Stockholm, Sweden
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:
Hoist
Level 21 , San Diego, United States
4 March, 05:49
See rather big red arrow )