Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    5
    Views
    1,538

    Re: Ask objects with parameters in Arraylist

    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...
  2. Replies
    5
    Views
    1,538

    Re: Ask objects with parameters in Arraylist

    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...
  3. Replies
    5
    Views
    1,538

    Re: Ask objects with parameters in Arraylist

    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...
Results 1 to 3 of 3