// Tyler Mi // A class representing a generic animal public class Animal { // If the fields are private, a subclass can't access the fields and needs // getter and setter fields to access them. Changing the access to protected // allows subclasses and other classes in the same folder to view/modify these // fields protected String name; protected String breed; protected double size; // Constructs an animal with the given name, breed, and size public Animal(String name, String breed, double size) { this.name = name; this.breed = breed; this.size = size; } // Returns the name of the animal public String getName() { return name; } // Returns the breed of the animal public String getBreed() { return breed; } // Returns the size of the animal public double getSize() { return size; } // The animal makes a sound public void makeSound() { System.out.println("gruh"); } // The animal introduces itself public void greet() { System.out.println("Hello my name is " + name); makeSound(); } }