Home > DeveloperSection > Forums > How to concatenate two arrays in Java?
Chintoo Semi

Total Post:135

Points:947
Posted on    May-16-2015 12:29 AM

 Java Java  Array 
Ratings:


 1 Reply(s)
 567  View(s)
Rate this:
I need to concatenate two String arrays in Java.
void f(String[] first, String[] second) {
    String[] both = ???
}
What is the easiest way to do this?


Mayank Tripathi
Mayank Tripathi

Total Post:397

Points:3117
Posted on    May-16-2015 7:43 AM

String[] both = ArrayUtils.addAll(first, second);

Don't want to miss updates? Please click the below button!

Follow MindStick