Anyone give me any insight as why the following snippet of code gives a cannot find symbol error, this swap() should be used as when given an array list name it will swap the contents of index location 1 with location 2
Cheers!
public static void swap(String swapArray, int location1, int location2) {
int tempswap1 = swapArray.get(location1);
int tempswap2 = swapArray.get(location2);
swapArray.set(location1)=tempswap2;
swapArray.set(location2)=tempswap1;
}