Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Pet and Owner Relationship | Classes Advanced
Java Extended
course content

Course Content

Java Extended

Java Extended

1. Deep Java Structure
2. Methods
3. String Advanced
4. Classes
5. Classes Advanced

book
Challenge: Pet and Owner Relationship

Task
test

Swipe to show code editor

  1. In the main method, create a Pet object called Garfield.
  2. Create an Owner object named Bob. Assign Bob as the owner of Garfield.
  3. Create a Pet object named Ben.
  4. Create an Owner object named Alice. Assign Alice as the owner of Ben.
  5. (Optional) You can also create your own pet and owner if you'd like.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 5. Chapter 2
toggle bottom row

book
Challenge: Pet and Owner Relationship

Task
test

Swipe to show code editor

  1. In the main method, create a Pet object called Garfield.
  2. Create an Owner object named Bob. Assign Bob as the owner of Garfield.
  3. Create a Pet object named Ben.
  4. Create an Owner object named Alice. Assign Alice as the owner of Ben.
  5. (Optional) You can also create your own pet and owner if you'd like.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 5. Chapter 2
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt