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) {
        GregorianCalendar gc = new GregorianCalendar();
        System.out.println("Current  Date: " + gc.getTime());
        // Add 1 year 
        gc.add(Calendar.YEAR, 1);
        System.out.println(gc.getTime());

        // Add 15 days 
        gc.add(Calendar.DATE, 15);
        System.out.println(gc.getTime());
    }
}