PDA

View Full Version : Array Objects


davidc2
08-01-2006, 07:34 AM
I have class ArrayX which has a constructor to 'create'
the array and I have ArrayXTest to test the other class.

On ArrayXTest I have something like:
ArrayX array = new ArrayX(); //to construct array 'A'
and ArrayX addend = new ArrayX(); //to construct the array I'll use on
method 'addition' of class ArrayX.

If I call method addition from the ArrayXTest class like:
array.addition(addend);
It goes to 'public void addition(ArrayX end)' on ArrayX.

In there I can get to any element and methods on array, just using
array[x][y] or array.determinant(), but only to methods of addend (using
something like end.determinant() or any other method... but not to its
elements (i.e. end[x][y])

How can I get to the elements of end? Is the argument wrong?

davidc2
08-01-2006, 09:19 AM
Got it... Used set and get methods, thanks :)

oracleguy
08-01-2006, 03:34 PM
In the future too, it is always good to say which language you are using since it isn't always 100% clear.