Java: 2 d array help

Discussion in 'OT Technology' started by zanyspy_dude, Mar 31, 2006.

  1. zanyspy_dude

    zanyspy_dude King of teh n00bz

    Joined:
    Aug 29, 2002
    Messages:
    4,473
    Likes Received:
    0
    Location:
    Indianapolis, IN
    I am making a b-tree. In my leaf nodes, i have keywords and they have values. Right now it's setup as a 2D string array String[][]. It would save me so much effort if i could make the second string[] be an array list. IS there anyway to do this very simply or do i actually have to write a billlion extra lines of code....
     
  2. ///M Pilot

    ///M Pilot New Member

    Joined:
    Mar 16, 2006
    Messages:
    405
    Likes Received:
    0
    Location:
    Fort Liquordale, FL
    Could you just use a hashtable instead?
     
  3. High Voltage

    High Voltage Guest

    i personally dont know because i am a beginner also at Java. check this link out though its a great resource for help

    http://java.sun.com/j2se/1.4.2/docs/api/
     
  4. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,486
    Likes Received:
    614
    I don't see any reason why you couldn't make an array of ArrayList. Try something like this:

    ArrayList[] lists = new ArrayList[50];

    Then you'd handle each list as lists[n].
     

Share This Page