SOLVED!
This is what i have and I am not sure what i am doing wrong. It keeps giving me errors!
public class Swapper { public static void main(String[] args){ public void swapFirstAndSecondHalf(int[] values) { int[] a = {1,2,3,4,5}; int k = 0; int temp = 0; while(k < a.length/ 2) { temp = a[k]; a[k] = a[a.length -1-k]; a[a.length-1-k] = temp; k++; } } // This method is used to check your work public int[] check(int[] values) { swapFirstAndSecondHalf(values); return values; } } }
Any help would be greatly appreciated!