Java Calendar isSet方法 Java Calendar isLenient方法 Java Calendar roll方法 Java Calendar isSet方法 package com.codingdict; import java.util.*; public class CalendarDemo { public static void main(String[] args) { // create a calendar Calendar cal = Calendar.getInstance(); // display the current calendar System.out.println("Current Day is " + cal.get(Calendar.DAY_OF_MONTH)); // determine if the given calendar field has a value set 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); } } Java Calendar isLenient方法 Java Calendar roll方法