Here you can find the source of yearToString(int year)
private static String yearToString(int year)
//package com.java2s; //License from project: Open Source License public class Main { private static String yearToString(int year) { String result = Integer.toString(year); if (result.length() < 4) result = "0000".substring(0, 4 - result.length()) + result; return result; }//from w ww. j av a 2 s. c o m }