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[] months = { "January", "February", "March", "April", "May", "June", "July", "August", "September",
                "October", "November", "December" };

        Calendar cal = Calendar.getInstance();
        String month = months[cal.get(Calendar.MONTH)];
        System.out.println("Month name: " + month);
    }
}