Results 1 to 2 of 2
  1. #1
    Preethi is offline Member
    Join Date
    Jan 2008
    Posts
    83
    Rep Power
    0

    Default Multi dimensional Array

    *i want to use nested array...can i use it java...ie.,if,i select a country i should get all states in it...How can i do this in an array..?

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default

    Have the first dimension be the country and the second dimension be the states for that country. Something like:
    Java Code:
    String[][] states = new String[nbrOfCountries][];
    states[0] = new String[nbrOfStates];
    states[0][0] = aState;

Similar Threads

  1. Array Reflection: Multi Array Reflection
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-23-2008, 08:08 PM
  2. How to initialize a two dimensional Array
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-14-2008, 08:48 PM
  3. Replies: 2
    Last Post: 01-07-2008, 07:45 PM
  4. Adding numbers in a 2 dimensional array
    By j0shizabeast in forum New To Java
    Replies: 2
    Last Post: 11-27-2007, 04:31 AM
  5. Help with array multi-dimensional
    By barney in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 08:00 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
  •