What is the difference between ArrayList
and List<>
in C#?
Is it only that List<>
has a type while ArrayLis
To add to the above points. Using ArrayList
in 64bit operating system takes 2x memory than using in the 32bit operating system. Meanwhile, generic list List
will use much low memory than the ArrayList
.
for example if we use a ArrayList
of 19MB in 32-bit it would take 39MB in the 64-bit. But if you have a generic list List
of 8MB in 32-bit it would take only 8.1MB in 64-bit, which is a whooping 481% difference when compared to ArrayList.
Source: ArrayList’s vs. generic List for primitive types and 64-bits