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) {

        Calendar cal = Calendar.getInstance();

        boolean b = cal.isSet(Calendar.DAY_OF_MONTH);
        System.out.println("Day of month is set: " + b);

        // clear day of month
        cal.clear(Calendar.DAY_OF_MONTH);

        // determine if the given calendar field has a value set
        b = cal.isSet(Calendar.DAY_OF_MONTH);
        System.out.println("Day of month is set: " + b);
    }
}