---
title: "How to concatenate two arrays in Java?"  
description: "How to concatenate two arrays in Java?"  
author: "Anonymous User"  
published: 2015-05-16  
updated: 2015-05-16  
canonical: https://www.mindstick.com/forum/23234/how-to-concatenate-two-arrays-in-java  
category: "java"  
tags: ["java", "array"]  
reading_time: 1 minute  

---

# How to concatenate two arrays in Java?

I need to [concatenate two](https://www.mindstick.com/forum/23314/in-java-how-to-concatenate-two-arrays) [String](https://www.mindstick.com/articles/1527/string-split-in-c-sharp) [arrays](https://www.mindstick.com/articles/11955/arrays-and-its-limitations) in Java.

```
void f(String[] first, String[] second) {    String[] both = ???}
```

What is the easiest way to do this?

## Replies

### Reply by Anonymous User

```
String[] both = ArrayUtils.addAll(first, second);
```


---

Original Source: https://www.mindstick.com/forum/23234/how-to-concatenate-two-arrays-in-java

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
