Here you can find the source of range(int min, int max)
Parameter | Description |
---|---|
min | a parameter |
max | a parameter |
public static int[] range(int min, int max)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w. jav a 2 s . c o m*/ * Returns an array of the form {@code [min, min + 1, ..., max - 1]} * * @param min * @param max */ public static int[] range(int min, int max) { int[] range = new int[max - min]; for (int i = 0; i < (max - min); i++) { range[i] = i + min; } return range; } }