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]
}
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]
}
public static void main(String[] args) {
int[] x = {1, 2, 3};
int[] y = {4, 5, 6};
int[] merge = new int[x.length + y.length];
for (int i = 0; i < x.length; i++) {
merge[i] += x[i];
}
for (int i = 0; i < y.length; i++) {
merge[x.length + i] += y[i];
}
System.out.println(Arrays.toString(merge));
}