Here you can find the source of range(int start, int length)
Parameter | Description |
---|---|
start | a parameter |
length | a parameter |
public static int[] range(int start, int length)
//package com.java2s; public class Main { /**/* w w w.j av a2 s.c om*/ * @param start * @param length * @return [start...length] (inclusive) */ public static int[] range(int start, int length) { int[] range = new int[length - start + 1]; for (int i = start; i <= length; i++) { range[i - start] = i; } return range; } }