HOW TO CONCATENATE TWO ARRAYS IN JAVA?

Chintoo Semi

Total Post:135

Points:947
Posted by  Chintoo Semi
Java  Array 
 890  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. Mayank Tripathi

    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!