|
|
@ -3,7 +3,7 @@ import java.util.Arrays; |
|
|
|
public class ArrayManipulation { |
|
|
|
|
|
|
|
|
|
|
|
public static int[] reverseArray(int[] arr) { |
|
|
|
public static int[] reverseArray(int[] arr, String name) { |
|
|
|
|
|
|
|
for (int i = 0; i < arr.length/2; i++) { |
|
|
|
int tmp = arr[i]; |
|
|
@ -16,7 +16,7 @@ public class ArrayManipulation { |
|
|
|
public static void main(String[] args) { |
|
|
|
|
|
|
|
int[] arr = {1,2,3,4,5}; |
|
|
|
System.out.println(Arrays.toString(reverseArray(arr))); |
|
|
|
System.out.println(Arrays.toString(reverseArray(arr, "Hannah"))); |
|
|
|
|
|
|
|
} |
|
|
|
public static int[] removeFirst(int[] arr) { |
|
|
|