Java Year From getYears(Integer limit)

Here you can find the source of getYears(Integer limit)

Description

get Years

License

Apache License

Declaration

public static List<Integer> getYears(Integer limit) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;
import java.util.Calendar;

import java.util.List;

public class Main {
    public static List<Integer> getYears(Integer limit) {
        List<Integer> years = new ArrayList<Integer>();
        Calendar calendar = Calendar.getInstance();
        int year = calendar.get(Calendar.YEAR);
        int count = year + limit;
        int i = (year);
        for (; i < count; i++) {
            years.add(i);//w w w  .  j a v  a2s  .  co m
        }
        return years;
    }
}

Related

  1. getYearMonthDays(int year, int month)
  2. getYearNumberofdays(String date)
  3. getYearOfDayMark(int day)
  4. getYearOfPreYearWeek(int year, int week)
  5. getYearOfTime(Long time)
  6. getyears(List numberList)
  7. getYearStart(int year)
  8. getYearStart(long ts)
  9. getYearStartTime()