Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Animal Information Display Challenge | 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

bookAnimal Information Display Challenge

Task

Your task is to bypass the private access modifier and create two objects with the necessary parameters, then display them.

  1. Create two objects of the Animal class — one for a cat and one for a dog.
  2. Use the Animal(String type, String name, String color) constructor to pass the parameters type, name, and color for each object.
  3. After creating the objects, use System.out.println() to print information about each animal.

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 4
toggle bottom row

bookAnimal Information Display Challenge

Task

Your task is to bypass the private access modifier and create two objects with the necessary parameters, then display them.

  1. Create two objects of the Animal class — one for a cat and one for a dog.
  2. Use the Animal(String type, String name, String color) constructor to pass the parameters type, name, and color for each object.
  3. After creating the objects, use System.out.println() to print information about each animal.

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 4
toggle bottom row

bookAnimal Information Display Challenge

Task

Your task is to bypass the private access modifier and create two objects with the necessary parameters, then display them.

  1. Create two objects of the Animal class — one for a cat and one for a dog.
  2. Use the Animal(String type, String name, String color) constructor to pass the parameters type, name, and color for each object.
  3. After creating the objects, use System.out.println() to print information about each animal.

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!

Task

Your task is to bypass the private access modifier and create two objects with the necessary parameters, then display them.

  1. Create two objects of the Animal class — one for a cat and one for a dog.
  2. Use the Animal(String type, String name, String color) constructor to pass the parameters type, name, and color for each object.
  3. After creating the objects, use System.out.println() to print information about each animal.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Section 5. Chapter 4
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
some-alt