Difference between an Array and ArrayList in dotnet framework
Loading
Difference between an Array and ArrayList in dotnet framework
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vishal YelvePosted Jun 14, 2025, 6:30 PM
ArrayArrayListobject)T[])Listinstead)Listinstead ofArrayListConceptual Differences
?? 1. Array
Declared with a specific type and fixed size.
Example:
Benefits:
Type safety (compile-time checking).
Better performance for value types.
Limitations:
Size is fixed after creation.
Can't mix different data types.
2. ArrayList
Part of System.Collections (non-generic).
Stores elements as object, allowing mixed types (not recommended).
Example:
Drawbacks:
Boxing/unboxing overhead with value types.
No compile-time type checking.
Example Comparison
Should You Use
ArrayList?No — use
Listinstead (fromSystem.Collections.Generic).In Summary:
ArrayListArrayList(not recommended)Sangeetha SPosted Jun 10, 2025, 6:09 AM
object)Listinstead)Listinstead)