Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import java.util.Calendar;

public class Main {

    public static String getCurrentMonth() {
        Calendar calendar = Calendar.getInstance();
        int nMonth = calendar.get(Calendar.MONTH) + 1;
        if (nMonth < 10)
            return "0" + Integer.toString(nMonth);
        else
            return Integer.toString(nMonth);
    }
}