Java tutorial
//package com.java2s; import java.util.Calendar; import java.util.LinkedList; import java.util.List; public class Main { public static List<String> getAniosConsulta() { Calendar c = Calendar.getInstance(); int anio = c.get(Calendar.YEAR); List<String> anios = new LinkedList<String>(); int amount = anio + 6; for (int i = anio; i < amount; i++) { anios.add("" + anio--); } return anios; } }