int temp;
int[] a = new int[]{5,123,45,6,2,9,4,51,66,22};
for(int i=0;i
temp=a[i];
a[j]=temp;
a[i]=a[j];
}
}
}
int[] a={1,2,5,6,7,8,9,3,4}
arrays.sort(a);
for(int i:a)
System.out.println(a[i]);