Search:

Type: Posts; User: Norm

Search: Search took 0.09 seconds.

  1. Replies
    19
    Views
    1,981

    Re: finding and deleting from an array?

    Did you test it? Did it work?

    Why have the boolean variable? Why not return index directly?


    Read the API doc for the ArrayList class to see what method(s) to use.
  2. Replies
    19
    Views
    1,981

    Re: finding and deleting from an array?

    Several new questions:
    What argument(s) will be passed to the method?
    What will the method return?


    The for loop is a natural for going through arraylists.
    The for Statement (The Java™...
  3. Replies
    19
    Views
    1,981

    Re: finding and deleting from an array?

    Ok, work on finding a Contact. Here are things to consider:
    Will the search be in a method? What will the method return?
    When you look at a Contact object, how do you determine it is the one you...
  4. Replies
    19
    Views
    1,981

    Re: finding and deleting from an array?

    Please say which part of the problem you are working on. I suggested in posts #2 and #4 that you make a list of the steps the program must take and then do them one at a time.
    One of the steps was...
  5. Replies
    19
    Views
    1,981

    Re: finding and deleting from an array?

    Your class names don't follow normal naming conventions. Classes are named for things. Methods are named for the actions they do.
    AddPersonalContact sounds like a method name. A better class...
  6. Replies
    19
    Views
    1,981

    Re: finding and deleting from an array?

    That code shouldn't compile. The method is defined to return an int value but it doesn't return anything.

    You should fix the compiler errors in the code you posted in #1 before trying to add more...
  7. Replies
    19
    Views
    1,981

    Re: finding and deleting from an array?

    No, the toString() method returns a String. It does NOT return an ArrayList.
    Look at the tutorial on how to define methods:
    Defining Methods (The Java™ Tutorials > Learning the Java Language >...
  8. Replies
    19
    Views
    1,981

    Re: finding and deleting from an array?

    What problems are you having writing the code? Take the items in the list one at a time:
    write a method that returns the arraylist.
  9. Replies
    19
    Views
    1,981

    Re: finding and deleting from an array?

    Where in the posted code are you having the problem?

    If you haven't written any code yet, can you list your ideas on how to implement the code you want to write as a list of simple...
Results 1 to 9 of 9