---
title: "Create ArrayList (ArrayList<T>) from array (T[]).."  
description: "Create ArrayList (ArrayList<T>) from array (T[]).."  
author: "Anonymous User"  
published: 2015-05-04  
updated: 2015-05-09  
canonical: https://www.mindstick.com/forum/23183/create-arraylist-arraylist-t-from-array-t  
category: "java"  
tags: ["java", "array", "array list"]  
reading_time: 1 minute  

---

# Create ArrayList (ArrayList<T>) from array (T[])..

I have an [array](https://www.mindstick.com/articles/335/jagged-array-in-c-sharp-dot-net) that is initialized like:\

```
Element[] array = {new Element(1), new Element(2), new Element(3)};
```

I would like to [convert](https://www.mindstick.com/forum/2093/configurationmanager-appsettings-convert-n-to-n-why) this array into an object of the [ArrayList](https://www.mindstick.com/articles/11973/arraylist-class-in-c-sharp) class.\

```
ArrayList<Element> arraylist = ???;
```

## Replies

### Reply by Anonymous User

Post is removed by the Admin.

### Reply by Anonymous User

```
new ArrayList<Element>(Arrays.asList(array))
```

\
You probably just need a List, not an ArrayList. In that case you can just do:\

```
List<Element> arraylist = Arrays.asList(array);
```


---

Original Source: https://www.mindstick.com/forum/23183/create-arraylist-arraylist-t-from-array-t

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
