Search:

Type: Posts; User: arhzz

Search: Search took 0.12 seconds.

  1. Replies
    28
    Views
    1,459

    [SOLVED] Re: Sorted list and compareTo method

    Okay, so inside the method insert I need to have those references?

    --- Update ---

    Okay I've figured it out




    class PhoneBookList implements PhoneBook {
  2. Replies
    28
    Views
    1,459

    [SOLVED] Re: Sorted list and compareTo method

    And that small fix is changing the person Class?
  3. Replies
    28
    Views
    1,459

    [SOLVED] Re: Sorted list and compareTo method

    Is there a way to implement that method without chaning the Person class?
  4. Replies
    28
    Views
    1,459

    [SOLVED] Re: Sorted list and compareTo method

    Hmmmm okay I'll give that a shot

    --- Update ---

    Okay so I've come up with something




    class PhoneBookList implements PhoneBook {
  5. Replies
    28
    Views
    1,459

    [SOLVED] Re: Sorted list and compareTo method

    So how would I use this method to tell it compare the person in the list with the one the user inputs?
  6. Replies
    28
    Views
    1,459

    [SOLVED] Re: Sorted list and compareTo method

    The variable name is defined in an class Person. Sure i'll use something a bit more descriptive.
  7. Replies
    28
    Views
    1,459

    [SOLVED] Re: Sorted list and compareTo method

    PhoneBookList.java:19: error: cannot find symbol
    int comparison = p.name.compareTo(person.name);
    ^
    symbol: variable name
    ...
  8. Replies
    28
    Views
    1,459

    [SOLVED] Re: Sorted list and compareTo method

    Well in the method insert no; That is if I've done everything and that includes; checking if a person with that name exists, if yes inserting that person if not returning false. And What do you mean...
  9. Replies
    28
    Views
    1,459

    [SOLVED] Re: Sorted list and compareTo method

    Hmmm okay gimme a few minutes to try to implement that.

    --- Update ---

    Aight I've implemented your suggestion like this;




    class PhoneBookList implements PhoneBook {
  10. Replies
    28
    Views
    1,459

    [SOLVED] Re: Sorted list and compareTo method

    Yes if the entry that we are trying to insert alredy exists the code should return false.Insert is susposed to create a new Person object(insert it in the list). The person contains a name,adress and...
  11. Replies
    28
    Views
    1,459

    [SOLVED] Re: Sorted list and compareTo method

    Aight I'll do that

    --- Update ---

    Okay after some trying I've decided to take the program step by step, in order to make it easier.The logical way implies to start with the method insert and...
  12. Replies
    28
    Views
    1,459

    [SOLVED] Re: Sorted list and compareTo method

    "I think the description of that code should be: compare the name of the person in the Node object with the string entered by the user."

    Yes that is exactly what i want the compare to method to...
  13. Replies
    28
    Views
    1,459

    [SOLVED] Re: Sorted list and compareTo method

    Okay, so after trying for 2 days straight I'm quite lost in this program.I cannot get it to work and I need some assistance. I put comments on parts of the code that I'm not sure how to implement and...
  14. Replies
    28
    Views
    1,459

    [SOLVED] Re: Sorted list and compareTo method

    Aight I'll try that, thanks!
  15. Replies
    28
    Views
    1,459

    [SOLVED] Sorted list and compareTo method

    Hey, so I need to write a program that simulates a phonebook. The program should contain the options to lookup a person,delete a person,insert a person, and too check the size(amount of persons...
Results 1 to 15 of 15