Here you can find the source of range(int start, int end)
public static Integer[] range(int start, int end)
//package com.java2s; //License from project: Open Source License public class Main { public static Integer[] range(int start, int end) { if (start > end) { throw new IllegalArgumentException(String.format("[%d, %d) illegal coordinates.", start, end)); }/*from w ww. j a v a 2 s . com*/ Integer[] array = new Integer[end - start]; for (int i = start, j = 0; i < end; i++, j++) { array[j] = i; } return array; } }