Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7893917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:15:27+00:00 2026-06-03T07:15:27+00:00

I have a requirement to create a 3-Dimensional ArrayList. ArrayList<ArrayList< ArrayList<Object>>> data_Header_Mapper; How can

  • 0

I have a requirement to create a 3-Dimensional ArrayList.

  ArrayList<ArrayList< ArrayList<Object>>> data_Header_Mapper; 

How can i populate the 3 D arraylist and how i acccess the leaf child ( Object) of 3 Dimensional ArrayList. Lots of thanks in advance for any help.

I am familiar working with Vectors , But due to some problems i want to convert the below code of Vectors to ArrayList.
Code For Populating 3 D Vectors is as follows.

  for (int r=0;r<totalRows;r++) // r - Rows
   {

     for (int c=0;c<totalViewedCols;c++) //c- Columns
     {

       cAct=0;
       while (cAct < totalActualCols)
      // for (int cAct=0;cAct<totalActualCols;cAct++) //c- Columns
       {
         if (Cols.get(cAct).toLowerCase().equals(columnName.toLowerCase())  )
         {
          ColValindex =  colHeader_ForSave.indexOf(columnName)  ;//Temp Comment
          colValue= (String)data_ForSave.elementAt(r).get(ColValindex);
         //  ColValindex =  header.indexOf(columnName)  ;
         //  colValue= (String)data.elementAt(r).get(ColValindex);

           data_Header_Mapper_Element.add(columnName); 
           data_Header_Mapper_Element.add(colValue); 
          }
         cAct++;
       }
       if (data_Header_Mapper_Element.size() !=0)
       {
        data_Header_Mapper_Row.add(data_Header_Mapper_Element);
       // data_Header_Mapper_Element.removeAllElements();
      data_Header_Mapper_Element =null;
      data_Header_Mapper_Element=new Vector<String>();
       }
     }
      if (data_Header_Mapper_Row.size() !=0)
     {
       data_Header_Mapper.add(data_Header_Mapper_Row);

       data_Header_Mapper_Row =null;
       data_Header_Mapper_Row=new Vector<Vector<String>>();
      }

   }

Code For Access 3 D Vectors is below

  for(int r=0;r<rowSize;r++)
      {

      for (int c=0;c<colSize;c++)
      {

      // To Build Insert And Update Query 
           columnDataType=  dbe.GetDataTypeOfTableColumn(rsMetaData,data_Header_Mapper.elementAt(r).get(c).get(0).toString());
           dataSize=dbe.GetDataSizeOfTableColumn(rsMetaData,data_Header_Mapper.elementAt(r).get(c).get(0).toString());
           Validation.ValidateData(columnDataType, data_Header_Mapper.elementAt(r).get(c).get(1), dataSize);

         }

        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T07:15:29+00:00Added an answer on June 3, 2026 at 7:15 am
    public class My3DArray {
    
        private List<List<List<Object>>> list;
    
        public My3DArray() {
            this.list = generate3DArray(5, 5, 5);
        }
    
        public List<List<List<Object>>> generate3DArray(int dim1, int dim2, int dim3) {
            List<List<List<Object>>> list = new ArrayList<List<List<Object>>>();
            for(int i = 0; i < dim1; i++) {
                List<List<Object>> list2 = new ArrayList<List<Object>>();
                for(int j = 0; j < dim2; j++) {
                    List<Object> list3 = new ArrayList<Object>(dim3);
                    list2.add(list3);
                }
                list.add(list2);
            }
            return list;
        }
    
        public Object getElementIn3DArray(int i, int j, int k)
            throws NullPointerException, ArrayIndexOutOfBoundsException {
            return list.get(i).get(j).get(k);
        }
    
        public void setElementIn3DArray(Object o, int i, int j, int k)
            throws NullPointerException, ArrayIndexOutOfBoundsException {
            list.get(i).get(j).add(o);
        }
    }
    
    public class Main {
        public static void main(String[] args) {
            My3DArray x = new My3DArray();
            x.setElementIn3DArray("Hello World", 0, 0, 0);
            System.out.println(x.getElementIn3DArray(0, 0, 0));
            System.exit(0);
        }
    }
    

    I omit some variables in the class like the dimensions but this is an idea. Its up to you how to use this example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HI, I have a requirement to create instance for list object at runtime using
I have a requirement to create a component which can be used stand-alone or
I have a requirement to create a simple database in Access to collect some
I have a requirement to create a windows form control which has to detect
I have a requirement to create a simple windows forms application that allows an
I have a requirement to create two different maps in C++. The Key is
I have a requirement to create a multi level treeview in ASP.Net (with VB)
If I have a requirement to create a data structure that has the following
For a project we have a requirement to create an interfacedefinition that will return
I am new to MySQL coming from Oracle. I have a requirement to create

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.