P
Pavel Maly
Hi,
how do I access values in an ArrayList which is a part of another ArrayList? I know I can define
a class and then it is quite simple, but this is just an auxiliary application to compute some
values used later in the program. There must be a simpler way to achieve this without defining
any (even temporary) class.
Simple example:
ArrayList OuterAL = new ArrayList();
for (int i = 0; i < OuterBound; i++)
{
ArrayList InnerAL = new ArrayList();
for (int j = 0; j < InnerBound; j++)
{
InnerAL.Add(i);
}
OuterAL.Add(InnerAL);
}
// Now I need to access, let's say, the third value in the second ArrayList in OuterAL.
// How do I do it?
TIA
Pavel
how do I access values in an ArrayList which is a part of another ArrayList? I know I can define
a class and then it is quite simple, but this is just an auxiliary application to compute some
values used later in the program. There must be a simpler way to achieve this without defining
any (even temporary) class.
Simple example:
ArrayList OuterAL = new ArrayList();
for (int i = 0; i < OuterBound; i++)
{
ArrayList InnerAL = new ArrayList();
for (int j = 0; j < InnerBound; j++)
{
InnerAL.Add(i);
}
OuterAL.Add(InnerAL);
}
// Now I need to access, let's say, the third value in the second ArrayList in OuterAL.
// How do I do it?
TIA
Pavel