current Year and return int - Android java.util

Android examples for java.util:Year

Description

current Year and return int

Demo Code


//package com.java2s;

import java.util.Calendar;

public class Main {
    public static int currentYear() {
        Calendar c = Calendar.getInstance();
        int year = c.get(Calendar.YEAR);
        return year;
    }/*  ww  w  . j  a  v  a2  s.c o m*/
}

Related Tutorials