How do I swap two array values given an array of integers and two integer values?
The code I used is
public class Q1K {
void swapElements(int[] array, int index1, int index2){
int index3= array[index1];
array[index1]=array[index2];
array[index2]= array[index3];
}
}
Sorry if my question is missing info/hard to understand