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

  • SEARCH
  • Home
  • 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 7159635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:15:49+00:00 2026-05-28T13:15:49+00:00

I have added some values to drawPoints[][] and then made an ArrayList Object points

  • 0

I have added some values to drawPoints[][] and then made an ArrayList Object points that is

ArrayList points=new ArrayList();
points.add(drawPoints);

Now i want to retrieve the value of drawPoints from points, how can i do that?

  • 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-05-28T13:15:50+00:00Added an answer on May 28, 2026 at 1:15 pm

    You need to access first drawPoints in your ArrayList with

    int[][] tmp = (int[][]) points.get(0);
    

    and then you will be able to get values with for example

    tmp[0][1];
    

    Here’s a little example of a program that prints values of two 2D arrays that are stored in an ArrayList:

    int[][] drawPoints = new int[2][2];
    int[][] drawPoints2 = new int[2][2];
    drawPoints[0][0] = 1;
    drawPoints[0][1] = 2;
    drawPoints[1][0] = 3;
    drawPoints[1][1] = 4;
    drawPoints2[0][0] = 5;
    drawPoints2[0][1] = 6;
    drawPoints2[1][0] = 7;
    drawPoints2[1][1] = 8;
    ArrayList<Object> points=new ArrayList<Object>();
    points.add(drawPoints);
    points.add(drawPoints2);
    
    for(Object tab : points){
        int[][] tmp = (int[][]) tab;
        for(int i=0;i < tmp.length;i++){ 
            for(int j=0;j<tmp[i].length;j++){ 
                System.out.println(tmp[i][j]);
            }
        }
        System.out.println("------------");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have added some dynamic textboxes upon a button click. I need the values
I have a dropdown control, with some values I added in using the designer.
I have a TreeView that is bound to a XmlDataSource control. I've added some
I have a stackpanel with some usercontrols that are added or removed during runtime.
I have a dictionary like class that I use to store some values as
i have created a resource file Resource.resx in my project and added some values
I have added some code which compiles cleanly and have just received this Windows
I have added some settings to my c# application using the configuration editor. There
In a RIA Domain service I have added some utility functions. For instance we
HI All. I have subclass of UIScrollView. IN this class I have added some

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.