Java Number Range Create range(int end)

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

Description

range

License

Open Source License

Declaration

public static int[] range(int end) 

Method Source Code

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

public class Main {
    public static int[] range(int end) {
        assert end > 0;
        int[] ary = new int[end];
        for (int i = 0; i < end; ++i) {
            ary[i] = i;/*from   w  w  w  .  j  a  v a  2  s. c o  m*/
        }
        return ary;
    }

    public static int[] range(int start, int end) {
        int l = end - start;
        assert l > 0;
        int[] ary = new int[l];
        for (int i = 0; i < l; ++i) {
            ary[i] = i + start;
        }
        return ary;
    }
}

Related

  1. range(double[] min, double[] max, double[] min2, double[] max2)
  2. range(double[] vals)
  3. range(final int max)
  4. range(float number, float value, float range)
  5. range(int begin, int end)
  6. range(int excludedEnd)
  7. range(int from, int to)
  8. range(int from, int to)
  9. range(int from, int to)