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.
Type: Posts; User: Norm
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.
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™...
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...
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...
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...
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...
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 >...
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.
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...