Java Number Range Create range(int min, int max)

Here you can find the source of range(int min, int max)

Description

Returns an array of the form [min, min + 1, ..., max - 1]

License

Open Source License

Parameter

Parameter Description
min a parameter
max a parameter

Declaration

public static int[] range(int min, int max) 

Method Source Code

//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;
    }
}

Related

  1. range(int from, int to)
  2. range(int from, int to)
  3. range(int i, int j)
  4. Range(int k, int from, int end)
  5. range(int low, int high)
  6. range(int min, int max)
  7. range(int min, int max, int value)
  8. range(int n)
  9. range(int start, int end)