Challenge: Pet and Owner Relationship
Task
Swipe to start coding
- In the
main
method, create aPet
object calledGarfield
. - Create an
Owner
object namedBob
. Assign Bob as the owner ofGarfield
. - Create a
Pet
object namedBen
. - Create an
Owner
object namedAlice
. AssignAlice
as the owner ofBen
. - (Optional) You can also create your own pet and owner if you'd like.
Solution
solution.java
Everything was clear?
Thanks for your feedback!
SectionΒ 5. ChapterΒ 2
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 2.63
Challenge: Pet and Owner Relationship
Swipe to show menu
Task
Swipe to start coding
- In the
main
method, create aPet
object calledGarfield
. - Create an
Owner
object namedBob
. Assign Bob as the owner ofGarfield
. - Create a
Pet
object namedBen
. - Create an
Owner
object namedAlice
. AssignAlice
as the owner ofBen
. - (Optional) You can also create your own pet and owner if you'd like.
Solution
solution.java
Everything was clear?
Thanks for your feedback!
Awesome!
Completion rate improved to 2.63SectionΒ 5. ChapterΒ 2
single