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

Total Post:135

Posted on    May-16-2015 12:29 AM

 Java Java  Array 

 1 Reply(s)
 829  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

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