How to concatenate two arrays in Java?

Total Post:135

Points:947
Java  Array 
 1211  View(s)
Ratings:
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?
  1. Post:397

    Points:3117
    Re: How to concatenate two arrays in Java?

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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!