if(d.askAge()==age){
That is the right way to see if the Dog object's age matches the required age.
The contains() method will not look at the contents of a Dog object.
You have to look at...
Type: Posts; User: Norm
if(d.askAge()==age){
That is the right way to see if the Dog object's age matches the required age.
The contains() method will not look at the contents of a Dog object.
You have to look at...
You have coded two different ways to call the askAge() method. The first one is correct, the second one should be changed to be like the first one. Use a reference to a Dog object to call a method...
The posted code has an if statement that will find dog objects with the age 5. Then what should the code do when it has found one? There is no code inside the if statement. Should there be a...