import java.util.Arrays;
class Main {
public static void main(String[] args) {
int[] x = {1,2,3,4,5};
swap(x,1,4);
System.out.println(Arrays.toString(x));
}
public static void swap(int[] x, int a, int b)
{
int temp = x[a];
x[a] = x[b];
x[b] = temp;
}
}