get Now Year - Java java.util

Java examples for java.util:Year

Description

get Now Year

Demo Code


//package com.java2s;

import java.util.Calendar;

public class Main {
    public static void main(String[] argv) throws Exception {
        System.out.println(getNowYear());
    }/*w  w w  . j av  a2 s.  c o m*/

    public static int getNowYear() {
        return Calendar.getInstance().get(Calendar.YEAR);
    }
}

Related Tutorials