Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Replies
    25
    Views
    2,816

    Re: Searching ArrayList For Specific Object

    Look at line 7 and find the null value and then backtrack in the code to see why it is null.
  2. Replies
    25
    Views
    2,816

    Re: Searching ArrayList For Specific Object

    How are the entries in the JTestfield separated? Is each on a new line?
    If so, get the text from the textfield into a String and use the split() method with the newline character.
    split() creates...
  3. Replies
    25
    Views
    2,816

    Re: Searching ArrayList For Specific Object

    The name would follow from what its purpose is. If it can only hold Contact objects, then that might be a good name. But the posted code uses Generics which means it can hold any type of object,...
  4. Replies
    25
    Views
    2,816

    Re: Searching ArrayList For Specific Object

    I wonder why the professor used the name of a Java SE interface for the name of his interface.

    Is the exercise: to write your own versions of list and arraylist?


    No, it does not look wrong. ...
  5. Replies
    25
    Views
    2,816

    Re: Searching ArrayList For Specific Object

    What is the difference between the Java SE ArrayList and your ArrayListC?

    What is the benefit of the new class?
  6. Replies
    25
    Views
    2,816

    Re: Searching ArrayList For Specific Object

    Does that say that the ArrayListC class is only to hold Contact objects? No other types like String or Integer?
  7. Replies
    25
    Views
    2,816

    Re: Searching ArrayList For Specific Object

    I disagree. It will be confusing.
  8. Replies
    25
    Views
    2,816

    Re: Searching ArrayList For Specific Object

    It's not a good idea to give your class the same name as a Java SE class. That will make for confusion.
    ArrayList is the name of a Java SE class. Choose a new name for your class.
  9. Replies
    25
    Views
    2,816

    Re: Searching ArrayList For Specific Object

    Have you read the API doc for the String class?
    Do you mean some other class?


    Use a loop to look at each object in the list.

    You are worrying about coding details before you have a design...
  10. Replies
    25
    Views
    2,816

    Re: Searching ArrayList For Specific Object

    Strange comparison. When would that be false? What values did you really want to compare there?

    Before writing any more code, try making a list in pseudo code of the steps the program should...
  11. Replies
    25
    Views
    2,816

    Re: Searching ArrayList For Specific Object

    What have you tried?
Results 1 to 11 of 11