Results 1 to 2 of 2
  1. #1
    JG4m3r is offline Member
    Join Date
    Mar 2012
    Posts
    16
    Rep Power
    0

    Question Reading value from two-dimensional ArrayList

    Hi guys, so I'm just wondering how I can read a value from a two dimensional ArrayList, because simply writing int i = randomArrayList.get(0,0); returns an error.

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default Re: Reading value from two-dimensional ArrayList

    A two dimensional array list is actually a one dimensional array list where each element is itself an ArrayList. Check the API for the get method and how it works, also, consider how you would index a 2d array (it's similar, but not identical).

Similar Threads

  1. Reading from txt file to arraylist
    By artur in forum New To Java
    Replies: 4
    Last Post: 02-10-2012, 05:51 AM
  2. Replies: 7
    Last Post: 09-27-2011, 12:29 AM
  3. reading two dimensional array
    By fr0s1yjack in forum New To Java
    Replies: 18
    Last Post: 06-23-2011, 04:16 PM
  4. Replies: 5
    Last Post: 03-12-2011, 02:04 AM
  5. Reading API for ArrayList
    By kian_hong2000 in forum New To Java
    Replies: 10
    Last Post: 08-22-2008, 07:09 PM

Posting Permissions

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