Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;

public class Main {
    /**
     * @return Return current year (IE 2015, 2016)
     */
    public static int getCurrentMonth() {
        Calendar cal = Calendar.getInstance();
        int year = cal.get(Calendar.MONTH);
        year += 1; //January returns 0, December returns 11. Add one to return
        return year;
    }
}