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 8021621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:02:26+00:00 2026-06-04T22:02:26+00:00

i am looking for a data structure to store two dimensional integer arrays. Is

  • 0

i am looking for a data structure to store two dimensional integer arrays.
Is List the rigth data structure or should i use another one?

Can someone give me a short example on how to create such a data structure and how to add a 2d array?

Edit: I want a data structure in which i want to store int[11][7] arrays.
For instance ten, int[11][7] arrays.

  • 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-04T22:02:28+00:00Added an answer on June 4, 2026 at 10:02 pm

    If you need to store a number of int[][] arrays in a data structure, I would probably recommend that you store the int[][] arrays in an Object that represents what the data contains, then store these Objects in an ArrayList.

    For example, here is a simple Object wrapper for your int[][] arrays

    public class 2DArray {
        int[][] array;
        public 2DArray(int[][] initialArray){
            array = initialArray;
        }
    }
    

    And here is how you would use them, and store them in an ArrayList

    // create the list
    ArrayList<2DArray> myList = new ArrayList<2DArray>();
    // add the 2D arrays to the list
    myList.add(new 2DArray(myArray1));
    myList.add(new 2DArray(myArray2));
    myList.add(new 2DArray(myArray3));
    

    The reason for my suggestion is that your int[][] array must have some meaning to you. By storing this in an Object wrapper class, you can give it a meaning. For example, if the values were co-ordinates, you would call your class Coordinates instead of 2DArray. You, therefore, create a List of Coordinates, which has a lot more meaning than int[][][].

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

Sidebar

Related Questions

I'm looking for a data structure that will store any DAG, but can efficiently
I am looking for a good data-structure to store a simple key value mapping,
I have two tables which have the exact same structure. Both tables can store
I'm looking for a data structure to store strings in. I require a function
I'm looking for a data structure that has the following properties. Stores a list
How can you 'two-way bind' a hierarchical data structure to a flat wpf datagrid?
I'm looking for a data-structure, or combination of several, that can give me a
I'm looking for a data structure that would allow me to store an M
I'm considering graph data structure implementations and am looking at the incidence list representation.
I am looking to store the following data structure: TIMESTAMP | NAME | COUNTS

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.