In the Development with the Force.com Platform book on pg 130, they mention that an Array's length is fixed when you initialize it and that multidimensional arrays are not supported. I just tried using the .add function on an array and it worked so I'm sure what they are talking about, but I couldn't make an array of arrays (which could have just been because I didn't have the right syntax). Ignoring syntax errors, there seems to be some sort of difference and thus maybe an (even if just slight) advantage to using one over the other?
|
There really aren't arrays in Apex, but you can use the array notation to declare lists. From the documentation on lists:
|
|||
|
|
|
In Salesforce basically an array is equivalent to a list only. The array notification declares a list only |
|||
|
|
|
All of the above answers are correct. In short you can use the array notation to declare a list. All list methods can be used with it. http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_list.htm The main difference is that Lists can be multi dimensional. i.e, list of lists. |
|||
|
|

List<List<String>> twoDimensionalList = new List<List<String>>();– Phil R Dec 14 '12 at 16:44