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[] a) {
        GregorianCalendar today = new GregorianCalendar();
        GregorianCalendar thisDate = new GregorianCalendar();
        thisDate.set(Calendar.YEAR, 2000);
        if (thisDate.before(today)) {
            System.out.println("before");
        }
        if (today.after(thisDate)) {
            System.out.println("after");
        }
    }
}