Question: Upper and lower bound generics exercise Create a class called AnimalFarm. Please add Dog , Yorkie and Animal to your project. Please create two methods.
Upper and lower bound generics exercise
Create a class called AnimalFarm. Please add Dog , Yorkie and Animal to your project.
Please create two methods. The first method will be a lower bound method. The method will accept Dog objects and any parents of Dog. The second method will be an upper bound method. The second method will accept Dog objects and any children objects of Dog. Both methods body will call the sound method to be printed.
Build a main method to test your two methods. Please test the two methods by attempting to pass a Dog, Yorkie, and Animal to both methods.
Take screenshots of the output and errors.
Submit a PDF or Word Document that contains the code pasted in, and the screenshots.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
