Java program
Create the following classes ANIMAL CLASS Create an Animal class. Each animal has a name, an x and y integer coordinate and a max speed which needs to be between 2 and 5. The Animal class should have at minimum the following methods below: .A default constructor that starts the animal at 0,0 with a name of "unknown" and a max speed of 2 A parameter constructor that allows the programmer to input all 4 pieces of information. Check for the constraints. If the input value is invalid, adjust it any way you deem necessary o getx gety . toString() This should print out the name and coordinates of the animal. o touching(Animal x) o This method should determine if the animal is on the same spot as the other animal (x). It should return a Boolean value of true if they are touching, and false if they are not on the same location. . move() o This should move the animal in a single random diretion (up, down, left, right) a random x number of units, where x is between 1 and the max speed (inclusive). Note that there are no parameters. The animal should self move. Check for the constraints. If the animal has moved outside the arena, adjust it any way you deem necessary to keep it in the grid. o o MAIN CLASS Inside your main class do the following Create an array that can hold 5 animals. Create a fight counter that starts at zero and a round counter. Fill the array with 5 different animals with different starting locations and values. You can decide where they start and the name. Print out the starting locations and names of all 5 animals. Then do the following loop. o o o Move all 5 animals randomly. Check all5 animals to see if any of them are on the same spot. If any of the animals are touching it should print out the word "FIGHT" to the screen and show the names of the two animals that are touching o Print out the current locations and names of all 5 animals. o Print a line"+-+-+-+-++++-4++-between each round of the movement. .Repeat the loop above until there are at least five fights. Print out the total number of fights. . Print out the total number of rounds that it took Finally print out the final location of all the animals