get Last Year - Java java.util

Java examples for java.util:Year

Description

get Last Year

Demo Code


//package com.java2s;

import java.util.Calendar;

public class Main {
    public static void main(String[] argv) throws Exception {
        System.out.println(getLastYear());
    }/*  w w w  .j  a  va 2 s. co m*/

    public static int getLastYear() {
        return Calendar.getInstance().get(Calendar.YEAR) - 1;
    }
}

Related Tutorials