|
@@ -1,9 +1,9 @@
|
|
|
package util;
|
|
|
|
|
|
+import java.util.Arrays;
|
|
|
+
|
|
|
public class ArrayUtil {
|
|
|
- public static String[] removeFirst(String[] oldArr) {
|
|
|
- String[] newArr = new String[oldArr.length - 1];
|
|
|
- System.arraycopy(oldArr, 1, newArr, 0, oldArr.length - 1);
|
|
|
- return newArr;
|
|
|
+ public static <T> T[] removeFirst(T[] oldArr) {
|
|
|
+ return Arrays.copyOfRange(oldArr, 1, oldArr.length);
|
|
|
}
|
|
|
}
|