Here you can find the source of getYear(String date)
public static int getYear(String date)
//package com.java2s; /*/* w w w .jav a 2s . c om*/ * License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt */ public class Main { /** * Get year * @return year */ public static int getYear(String date) { return Integer.parseInt(date.substring(0, 4)); } }