Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.ArrayList;

public class Main {
    public static String[] getValueByGap(int max, int min, int gap) {

        ArrayList<String> list = new ArrayList<String>();
        for (int i = min; i <= max; i += gap) {
            list.add(String.valueOf(i));
        }
        String[] s = new String[list.size()];
        return list.toArray(s);
    }
}