Results 1 to 3 of 3
  1. #1
    Guy
    Guy is offline Member
    Join Date
    Jul 2011
    Posts
    42
    Rep Power
    0

    Question Accessing arrays from an ArrayList

    Hey, I have a small problem that I don't seem to be able to figure out. I have an ArrayList<string[]> which contrains a whole lot of String arrays. How do I change an element of one of the arrays within the arraylist.
    Incase I'm not making my self clear, what I want to do is: arrayList[1]array[0] = "a"; But it won't let me do it like that. This is my first time using arraylists so not entirely sure how they work.

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    786
    Rep Power
    5

    Default Re: Accessing arrays from an ArrayList

    arraylist.get(index)[indexOfTheArray] = ".....";

    API DOC: http://docs.oracle.com/javase/6/docs....html#get(int)

  3. #3
    Guy
    Guy is offline Member
    Join Date
    Jul 2011
    Posts
    42
    Rep Power
    0

Similar Threads

  1. JSTL accessing properties on an object that extends ArrayList
    By chester_perry in forum Advanced Java
    Replies: 6
    Last Post: 07-29-2013, 05:54 PM
  2. Replies: 5
    Last Post: 01-18-2010, 07:00 AM
  3. Replies: 12
    Last Post: 11-05-2009, 07:12 AM
  4. Arraylist with arrays?
    By Dieter in forum Advanced Java
    Replies: 13
    Last Post: 09-19-2009, 11:10 PM
  5. Accessing arrays in another class
    By rosh72851 in forum New To Java
    Replies: 6
    Last Post: 10-31-2008, 12:09 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •