Some help why my result is wrong?
package com.codegym.task.task21.task2113;
import java.util.List;
class Hippodrome {
private List<Horse> horses;
Hippodrome(List<Horse> horses) {
this.horses = horses;
}
public List<Horse> getHorses() {
return horses;
}
public static void main(String[] args) {
}
}
/*
Hippodrome (part 1)
Today we'll write a small game called 'Hippodrome'.
And when I say we, I mean you. I will be your mentor.
To start, we'll need Hippodrome and Horse classes.
Create the Hippodrome and Horse classes.
And don't forget that every program starts with a main method.
Add one to the Hippodrome class.
Requirements:
1. The Hippodrome class must be in a separate file.
2. The Horse class must be in a separate file.
3. The Hippodrome class must be declared with the public access modifier.
4. The Horse class must be declared with the public access modifier.
5. A public static void main(String[] args) method must be created in the Hippodrome class.
Hippodrome (part 2)
Hey, we've got a hippodrome, and it should have some horses.
So our hippodrome should store a list of its horses.
Add a List<Horse> horses field to the Hippodrome class.
And to ensure that the horses won't be stolen, make this field private.
Add a getter for this field.
Requirements:
1. A horse list (horses) must be created in the Hippodrome class.
2. A getHorses method that returns the horses list must be created in the Hippodrome class.
3. The getHorses method must be declared with the public access modifier.
4. The horses field must be declared with a private access modifier.
*/