Browse Source

add removeFirst method

dennis
Dennis 3 years ago
parent
commit
37050a39c4
  1. 12
      ArrayManipulation.java

12
ArrayManipulation.java

@ -14,6 +14,18 @@ public class ArrayManipulation {
return arr;
}
public static int[] removeFirst(int[] arr) {
int[] newArray1 = new int[arr.length -1];
for (int i = 1; i < newArray1.length + 1; i++) {
newArray[i - 1] = arr[i];
}
return arr;
}
public static int[] removeLast(int[] arr) {
int[] newArray = new int[arr.length - 1];

Loading…
Cancel
Save