Question: Add a static counter to the dog class. Create a variable to hold the dog s id . Update the constructor ( s ) to
Add a static counter to the dog class. Create a variable to hold the dogs id
Update the constructors to use the static variable to assign a unique id to every dog that is created.
Add an equals method to the dog class. Two dogs should be considered equal if they have the same id
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
