Here you can find the source of range(int start, int end)
Parameter | Description |
---|---|
start | the value at the first position in the array |
end | the value at the last position in the array |
public static int[] range(int start, int end)
//package com.java2s; //License from project: Open Source License public class Main { /**// w ww . ja v a 2 s . c om * Returns an array of all integers [start..end) exclusive. * * @param start the value at the first position in the array * @param end the value at the last position in the array * @return the array of integers [start..end) */ public static int[] range(int start, int end) { final int size = end - start; final int[] array = new int[size]; for (int i = 0; i < array.length; i++) { array[i] = i + start; } return array; } }