Java Number Range Create range(int from, int to)

Here you can find the source of range(int from, int to)

Description

range

License

BSD License

Declaration

public static int[] range(int from, int to) 

Method Source Code

//package com.java2s;
//License from project: BSD License 

public class Main {
    public static int[] range(int from, int to) {
        if (to < from)
            throw new IllegalArgumentException("to must be larger than from");
        int[] out = new int[to - from];
        for (int i = 0; i < out.length; i++)
            out[i] = from + i;/* w  ww .  j  a v  a  2  s .  co  m*/
        return out;
    }
}

Related

  1. range(float number, float value, float range)
  2. range(int begin, int end)
  3. range(int end)
  4. range(int excludedEnd)
  5. range(int from, int to)
  6. range(int from, int to)
  7. range(int i, int j)
  8. Range(int k, int from, int end)
  9. range(int low, int high)