Solved

Accessing items in ArrayList of ArrayLists

Posted on 2006-11-29
1
768 Views
Last Modified: 2008-02-01
Hi

I have an ArrayList (al) and I add Arraylists to it.
Is there a simple way to get the first item of the first arraylist?
Or the sixth item of the first arraylist?
thanks
HMC
0
Comment
Question by:hmcgeehan
1 Comment
 
LVL 2

Accepted Solution

by:
BogdyPtr earned 20 total points
ID: 18035784
Try ((ArrayList)al[0])[0] to get first element of the first ArrayList.
A more elegant solution is to use generic List class instead of the main array list:

List<ArrayList> arrays;

...

arrays[1][2] = 5;
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now