B
Bad_Kid
arraylist / array ???
what is better for what?
what is better for what?
Bad_Kid said:arraylist / array ???
what is better for what?
An ArrayList is better when you have heterogenous collections, or you need
dynamic list-like behavior. If you know that you have 5 instances of Apple,
use an array.
A native C# array has elements of a specific type:
Apple[] arr = new Apple[2];
arr[0] = new Apple();
arr[1] = new Orange(); // compiler error