---
title: "what is difference between Array and ArrayList?"  
description: "what is difference between Array and ArrayList?"  
author: "Samuel Fernandes"  
published: 2017-08-25  
updated: 2017-08-28  
canonical: https://www.mindstick.com/forum/34335/what-is-difference-between-array-and-arraylist  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# what is difference between Array and ArrayList?

i have more confusion in [Array](https://www.mindstick.com/articles/335/jagged-array-in-c-sharp-dot-net) and ArrayList. please help with example

## Replies

### Reply by Niraj Kumar Mishra

## Array:

1. Array is strongly typed. This means that an array can store only specific type of items\elements.

2. Array stores fixed number of elements. Size of an Array must be specified at the time of initialization.

3. No need to cast elements of an array while retrieving because it is strongly type and stores specific type of items only.

**Declaration of Array**

```
string[] arr=new string[2];arr[0] = "welcome";arr[1] = "Aspdotnet-suresh" 
```

In above code I declared array size 2 that means we can store only 2 string values in array.

**ArrayList:**\

1. ArrayList can store any type of items\elements.

2. ArrayList grows automatically and you don't need to specify size.

3. Items of ArrayList need to be cast to appropriate data type while retrieving.

**Declaration of ArrayList**

```
ArrayList strarr = new ArrayList();strarr.Add("welcome"); // Add string valuesstrarr.Add(10);   // Add integer valuesstrarr.Add(10.05); // Add float value
```

If you observe above code I haven’t mentioned any size in array list we can add all the required data there is no size limit and we will use add method to bind values to array list.

\


---

Original Source: https://www.mindstick.com/forum/34335/what-is-difference-between-array-and-arraylist

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
