Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Calendar;
import java.util.GregorianCalendar;

public class Main {

    public static void main(String[] args) {

        Calendar cal = new GregorianCalendar(2013, 05, 20);

        System.out.println("Past calendar : " + cal.getTime());

        // create a clone of first cal
        Calendar cal2 = (Calendar) cal.clone();

        System.out.println("Cloned calendar : " + cal2.getTime());
    }
}