public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[] arr1=new int[N];
for(int i=0;i<N;i++)
{
arr1[i]=sc.nextInt();
}
System.out.println("print elements of the 2nd array");
int M = sc.nextInt();
int[] arr2=new int[M];
for(int i=0;i<M;i++)
{
arr2[i]=sc.nextInt();
}
int[] sumarray=new int[N];
for(int i=0;i<N;i++)
{
sumarray[i]=arr1[i]+arr2[i];
}
for(int val:sumarray)
{
System.out.println(val);
}
}
}
this is my code