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

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

Description

range

License

Open Source License

Declaration

public static Integer[] range(int start, int end) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static Integer[] range(int start, int end) {
        if (start > end) {
            throw new IllegalArgumentException(String.format("[%d, %d) illegal coordinates.", start, end));
        }/*from   w  ww.  j a v a 2 s  . com*/
        Integer[] array = new Integer[end - start];
        for (int i = start, j = 0; i < end; i++, j++) {
            array[j] = i;
        }
        return array;
    }
}

Related

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