Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static String[] getListOfCarYears() { String years = ""; Calendar cal = Calendar.getInstance(); for (int i = cal.get(Calendar.YEAR) + 1; i > cal.get(Calendar.YEAR) - 25; i--) { years += i + ","; } return years.substring(0, years.length() - 1).split(","); } }