package inging;
import java.util.Scanner;
public class Twolist {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
System.out.print("Enter list1 size and contents:");
int n = in.nextInt();
int []List1 = new int[n];
for(int i=0;i<List1.length;i++) {
List1[i] = in.nextInt();
}
System.out.print("Enter list2 size and contents:");
int m = in.nextInt();
int []List2 = new int[m];
for(int i=0;i<List2.length;i++) {
List2[i] = in.nextInt();
}
System.out.print("List1 is ");
for(int i=0;i<n;i++) {
System.out.println(List1+" ");
}
System.out.print("List2 is ");
for(int p: List2) {
System.out.println(List2+" ");
}
int []List3 = new int[n+m];
System.arraycopy(List1,0,List3,0,List1.length);
System.arraycopy(List2, 0, List3, List1.length, List2.length);
java.util.Arrays.sort(List3);
System.out.print("The merged list is ");
for(int p: List3) {
System.out.print(List3+" ");
}
}
}