Here you can find the source of getYearFirst(int year)
public static Date getYearFirst(int year)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date getYearFirst(int year) { Calendar calendar = Calendar.getInstance(); calendar.clear();//from w ww . j av a 2 s. c om calendar.set(Calendar.YEAR, year); Date currYearFirst = calendar.getTime(); return currYearFirst; } }