haraprasad mohapatra wrote:int i[]={10,20,3,2,4};
int j[]={5,2,15,16,18};
. . . .
output :
{0 1 2 4}
. . .
In Java® always put the [] as part of the type. It should read
int[] array not
int array[]. The fact that you can get such code past the compiler does not make it good code
I find it understand how you get from two 5‑element arrays to one 4‑element array. Why is the 2 matched? Does it mean there is a 2 in the other array at any location? I presume this is an exercise in using nested loops. If so, please use variable names which people can understand. Things like
nii are very difficult to understand.