Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.Calendar; import java.util.List; public class Main { public static List<String> GetYearList(int count) { int year = Calendar.getInstance().get(Calendar.YEAR); List<String> yearList = new ArrayList<String>(); for (int i = year - count; i <= year; i++) { yearList.add(Integer.toString(i)); } return yearList; } }