int a[]={10,20,30,40,50}; int b[]=new int[a.length]; //copying one array to another b=Arrays.copyOf(a,a.length);