public class Foo {
public static void main(String[] args) {
String[] A = { "HELLO ", "HELLO ", "HELLO ", "HELLO ", "HELLO " };
String[] B = { "Jack", "Tom", "Lee", "John", "Alisa" };
String[] C = merge(A, B);
for (int i = 0; i < C.length; i++) {
System.out.print(C[i] + ",");
}
}
public static String[] merge(String[] A, String[] B) {
int length = A.length;
if (A.length > B.length) {
length = B.length;
}
String[] C = new String[length];
for (int i = 0; i < length; i++) {
C[i] = A[i] + B[i];
}
return C;
}
}