Here you can find the source of slice(String[] array, int a, int b)
public static String[] slice(String[] array, int a, int b) throws Exception
//package com.java2s; //License from project: Apache License public class Main { public static String[] slice(String[] array, int a, int b) throws Exception { String[] newarray = new String[b - a]; if (!(a < array.length && b <= array.length)) { throw new Exception("out of bound:" + a + "," + b); }/*w w w .ja v a 2s . c o m*/ for (int i = a; i < b; i++) { newarray[i - a] = array[i]; } return newarray; } }