You need to sign in to do that
Don't have an account?

how to declared two-dimensional array in apex class
Hi
i want to declare this.......
private Double[][] matrix;
but i am getting error.i am not find a solution to declaration of 2-D array.
Please give me a solution to declared 2-D array because i am working of 2D matrix inversion.
It is most requirement in our project.
Thanks & Regards
Brijesh kumar baser
A list can contain any object, including Doubles
David
Message Edited by David VP on 10-06-2008 01:14 PM
But i want to declare 2-D array because i want to calculate inverse of matrix.
I think for matrix declaration we use 2D array.
Matrix dimensions are 12*1.
So please give me a solution to declare two dimensional array.
Thanks & Regards
Brijesh Kumar Baser
If you say that the matrix dimensions are 12*1 then I'm not sure if I'm really following you on the '2D' part of your question ?
Anyway, to see the List of List trick in action, throw this in your System Log window and execute it :
David
Here is an example on how initialize a two-dimensional array in apex.
// Two demensonal array
List<List<String>> arrayList = new List<List<String>>
{
new String[]{'Item 1', 'Item 2'},
new String[]{'Item 1', 'Item 2'}
};