array merge java code example
Example: combine two array in java
public static void main(String[] args) {
// for each ile cozumu
String[] arr3 = {"A", "B", "C","Z","N"};
String[] arr4 = {"D", "E", "F","G","U"};
ArrayList<String> list1 = new ArrayList<>(); //[A, B, C, Z, N, D, E, F, G, U]
for( String each: arr3 ){
list1.add( each );
}
for(String each1 : arr4 ){
list1.add(each1);
}
System.out.println(list1); // [A, B, C, Z, N, D, E, F, G, U]
}