Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Calendar;

public class Main {
    public static void main(String[] args) {
        String[] monthName = { "January", "February", "March", "April", "May", "June", "July", "August",
                "September", "October", "November", "December" };

        Calendar cal = Calendar.getInstance();
        String month = monthName[cal.get(Calendar.MONTH)];

        System.out.println("Month name: " + month);
    }
}