Search:

Type: Posts; User: 93tomh

Search: Search took 0.11 seconds.

  1. Replies
    19
    Views
    1,983

    Re: finding and deleting from an array?

    I GOT IT! :D

    Thank you very much for your help and suggestions norm, it is very appreciated!
  2. Replies
    19
    Views
    1,983

    Re: finding and deleting from an array?

    so now i have



    public int findContactIndex(String firstName, String secondName)
    {
    int index = 0;
    boolean found = false;
    while(index<contactList.size() && !found)...
  3. Replies
    19
    Views
    1,983

    Re: finding and deleting from an array?

    Yes, it will be in a method of its own, and im hoping to return the name address and all the details of that entity. Am i going to be trying to say "if firstName == fName && secondName == sName" but...
  4. Replies
    19
    Views
    1,983

    Re: finding and deleting from an array?

    Im trying to work on the finding contact first. Also I dont know how to return an array list, ive been trying to understand it forages now but cant get my head around it. What annoys me about this is...
  5. Replies
    19
    Views
    1,983

    Re: finding and deleting from an array?

    I was always taught in uni to use things like 'addPersonalContact' for a method, and its what i am used to. I have reposted the account code, which i missed off the last bit by accident first time....
  6. Replies
    19
    Views
    1,983

    Re: finding and deleting from an array?

    and sorry, missed the end bit ... silly me



    private int findAccount(String accountNumber)
    {
    int index = 0;
    boolean found = false;
    while(index < accounts.size()...
  7. Replies
    19
    Views
    1,983

    Re: finding and deleting from an array?

    Would it not compile because i didnt give you the other 3 classes that are used? Because it compiles at my end perfectly.





    public abstract class Contact
    {
    protected String fName;
    ...
  8. Replies
    19
    Views
    1,983

    Re: finding and deleting from an array?

    sorry i havent replied, i tried for a couple of hours yesterday to get my head around this and got nowhere. But digging up some of my old assignments I found this piece of code, would what i am...
  9. Replies
    19
    Views
    1,983

    Re: finding and deleting from an array?

    I know that


    public String toString() {
    final StringBuilder output = new StringBuilder("All Contacts:\n");
    for (Contact contact : contactList) {
    ...
  10. Replies
    19
    Views
    1,983

    Re: finding and deleting from an array?

    I want to search by first and last name, im guessing for finding a contact;

    1. returning the full array list and then sorting the results by name
    or
    2. Searching through the array list only for...
  11. Replies
    19
    Views
    1,983

    finding and deleting from an array?

    Ok, so im struggling to find a 'contact' and also deleting a 'contact' in my array list. Can anyone tell me how i can do this? Thanks



    import java.util.ArrayList;

    public class ContactList
    {...
Results 1 to 11 of 11