Search:

Type: Posts; User: Norm

Search: Search took 0.14 seconds.

  1. Replies
    23
    Views
    1,642

    Re: I have problem a colections

    The code is still passing the reference to the Scanner object instead of the value read in from the user into the variables: m and l

    Note: m and l are poor names for variables that hold important...
  2. Replies
    23
    Views
    1,642

    Re: I have problem a colections

    Please copy the full text of the error message and paste it here.
    Also post the code where the error happens.

    Note: the name: getDesiredValue was only meant as an example. You need to change it...
  3. Replies
    23
    Views
    1,642

    Re: I have problem a colections

    The Car class needs to have get methods that return the value you want to test.
    In the foreach loop, the variable: a has the reference to the Car object.
    Note: a is a poor name for a variable...
  4. Replies
    23
    Views
    1,642

    Re: I have problem a colections

    Look at post#9. It reads the values from the user in the main method into m and l.
    It should pass those values to the method as was done in post#3 instead of the 1,2 that was passed.
  5. Replies
    23
    Views
    1,642

    Re: I have problem a colections

    What does that mean? If the code is designed and written incorrectly, it needs to be changed.
  6. Replies
    23
    Views
    1,642

    Re: I have problem a colections

    You can use the Scanner class to read that number from the console outside of the printCarsToValueAndLevelOfEquipment method.
    Then pass that number to the method as an argument. See your post#3
    ...
  7. Replies
    23
    Views
    1,642

    Re: I have problem a colections

    The values to test for should be acquired before the call to the method and then passed as a parameter to the method.
    The method should not be asking the questions and getting the responses.
  8. Replies
    23
    Views
    1,642

    Re: I have problem a colections

    What does "doesn't work" mean?
    Is there an error message? Please copy the full text and paste it here.
    Executing the statement does not give the desired result. Print out any evidence that shows...
  9. Replies
    23
    Views
    1,642

    Re: I have problem a colections

    Add a toString method to the Car class that returns the String you want to be shown on that print out.
    The Strings shown in that print out are what is returned by the default toString method for the...
  10. Replies
    23
    Views
    1,642

    Re: I have problem a colections

    Work through the problems one at a time.
    Post one of the problems you are having and describe what the code needs to do for that problem.

    If your problem is doing a sort, google about how to use...
  11. Replies
    23
    Views
    1,642

    Re: I have problem a colections

    What problems are you having with designing it?
    I see that The comments say what it is supposed to do.
  12. Replies
    23
    Views
    1,642

    Re: I have problem a colections

    Please post the code in question here on the forum. Be sure to wrap the code in code tags.
Results 1 to 12 of 12