Course Content
Java Extended
Java Extended
Challenge: Pet and Owner Relationship
Task
Swipe to show code editor
- 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
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 5. Chapter 2
Challenge: Pet and Owner Relationship
Task
Swipe to show code editor
- 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
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 5. Chapter 2
Switch to desktop for real-world practiceContinue from where you are using one of the options below