Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.*;

public class Main extends GregorianCalendar {

    public static void main(String[] args) {

        Main cal = new Main();

        // set a new year
        cal.set(GregorianCalendar.YEAR, 1992);
        System.out.println(cal.getTime());

        // compute fields and print the date
        cal.computeFields();
        System.out.println(cal.getTime());
    }
}