Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

error in insert function

Options
  • 05-03-2008 3:15pm
    #1
    Closed Accounts Posts: 20


    public static PhoneBookEntry [] insert(PhoneBookEntry p, PhoneBookEntry [] aContacts) {
    int len = aContacts.length;
    PhoneBookEntry [] aContacts2 = new PhoneBookEntry[len+1];

    for (int x=0; x<len; x++) {
    aContacts2[x] = aContacts[x];
    }

    aContacts2[len+1].name = p.name;
    aContacts2[len+1].number = p.number;

    aContacts = aContacts2;
    System.out.println("Name" + aContacts[0].name + " Number " + aContacts[0].number);


    return aContacts2;
    }


Comments

  • Closed Accounts Posts: 3,357 ✭✭✭Beano


    you're going to have to give a little more info.


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    How are people supposed to help you when you don't even tell us what's going wrong?

    Try again. State what your trying to achieve, what the problem is and where you think it is occuring. Include any error messages.

    ffs.


This discussion has been closed.
Advertisement