Java tutorial
//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); } }