ArrayLists are single dimensional.
You're talking about two different types of objects. The arrays like foo[ x ] [ y ] are one type of object, addressed by the indices in square brackets. The array is allocated in a fixed size when you create it--you can't change the size once it's created.
ArrayLists are another type of object. They grow dynamcially as you add more objects. You use get() and add() to retrieve and add objects. You can also add objects of multiple types to an ArrayList, though that is not necessarily a good idea.
If you want to get tricky, define an object that has the two operands to the ArrayList, and then define a method that computes the result of addition.
class Foo
{
int first;
int second;
public Foo(first, second)
{ this. first = first;
this.second = second;
}
public int getResult()
{
return first + second;
}
}
Add that object to the arrayList.