CodeGym /Courses /Java Core /Inheritance exercises

Inheritance exercises

Java Core
Level 1 , Lesson 6
Available

"Hello, Amigo! Here's another group of exercises on inheritance. Enjoy."

3
Task
Java Core, level 1, lesson 6
Locked
Horse and Pegasus
In ancient mythology, the winged horse Pegasus was born from a drop of Medusa's blood that fell to the earth. Other variations of the myth claim his father was Poseidon. Let's imagine for a moment, that rather than being created by a Greek God or Medusa's blood, that Pegasus' father was simply a horse. In this task, you'll need to edit the Horse and Pegasus classes to make Pegasus a descendant of Horse.
3
Task
Java Core, level 1, lesson 6
Locked
Pets
Among animal breeders and pet lovers, you'll occasionally find fans of iguanas, chinchillas, and other exotic animals. But just being on the spaceship GalaxyRush is exotic enough. So here folks prefer the more traditional cats and dogs. In this task, we'll create the Pet class and write descendants Cat and Dog for it.
3
Task
Java Core, level 1, lesson 6
Locked
Interplanetary farm
The spaceship GalaxyRush has crossed paths with the agro-ship Moo. The local farmers aren't bad people, but they don't understand a thing about programming. So, CodeGym students decided to help them out and started to write a program for keeping track of their livestock. Your task in this job is to create the Animal class and its descendants: Cow, Sheep, Bull, Goat, and Pig.
3
Task
Java Core, level 1, lesson 6
Locked
Hard workers
Even the most important executive was once a lowly noob. Let's imagine that you've taken a job as a secretary, but you hope to eventually become a manager. What do you, your manager, and the CEO all have in common? You are all employees. In this task, you need to create an Employee class, and make the rest of the classes inherit it.
3
Task
Java Core, level 1, lesson 6
Locked
IT company
CodeGym graduates have decided to form a startup that will write programs for a very important spaceport. But here's the problem: They have absolutely no time to write the software needed for their in-house needs. So, their mentor has arranged to have students on the second quest help with the project. You need to create a couple of employee classes and their descendants.
Comments (27)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Craig McCollum Level 20, Belgrade, United Kingdom
10 November 2024
:) OK I get it you can extend other classes 😂
ImDevin Level 15, Old Town, United States
21 May 2021
too easy. makes me afraid of what's coming next 😱
Anonymous #11294308 Level 19, Roseville, United States
3 April 2023
Hahah me too
Raj Mishra Level 15, India, India
14 December 2020
Tasks for this chapter (level 11) is not loading in intellij. I have tried restarting intellij 4 to 5 times
John Squirrels Level 40, San Francisco, Poland
15 December 2020
Please try to choose level 1 of your current quest.
John Squirrels Level 40, San Francisco, Poland
15 December 2020
That is how the course is represented. Yes, you are on level 11, but in IDEA it is level 1 of quest Core. Please choose it correctly in the filter.
Naughtless Level 41, Olympus Mons, Mars
3 June 2021
That could really use a rework. If CodeGym's userbase were to increase to say, 10 million people, the current system would cause a lot of unnecessary confusion. Just a feedback.
P.B.Kalyan Krishna Level 22, Guntur, India
27 June 2021
Select Java core quest and select Level 1
Chandan Thapa Level 22, Dubai, United Arab Emirates
11 November 2020
that was a quick one!
BLANC Level 12, Paris, France
26 July 2020
Yeah, these tasks were relaxing. My scars were healing during this time!
Angel Li Level 18, Fremont, United States
27 June 2020
Wow breezed through in less than 5 minutes! Nice break after Java Syntax.
Thomas Sixberry Level 16, Rochester Hills, United States
7 February 2020
Easy tasks every once in awhile makes my brain rejoice!
Antali András Level 17, Budapest, Hungary
12 January 2020
Buckshee points :-)
MaGaby2280 Level 41, Guatemala City, Guatemala
18 November 2019
Very refreshing exercices after the hard syntax ones!
Kevin Duc Level 17, Denver, United States
31 August 2019
This is so relaxing compared to the syntax XD