Java Number Range Create range(int start, int length)

Here you can find the source of range(int start, int length)

Description

range

License

Open Source License

Parameter

Parameter Description
start a parameter
length a parameter

Return

[start...length] (inclusive)

Declaration

public static int[] range(int start, int length) 

Method Source Code

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

Related

  1. range(int start, int end)
  2. range(int start, int end)
  3. range(int start, int end)
  4. range(int start, int end)
  5. range(int start, int end, int step)
  6. range(int start, int length, int step)
  7. range(int start, int stop)
  8. range(int startValue, int endValue)
  9. range(int unit)