Java tutorial
import java.util.Calendar; public class Main { public static void main(String[] args) { Calendar cal = Calendar.getInstance(); // print current state of lenient boolean b = cal.isLenient(); System.out.println("Calendar is lenient :" + b); // change lenient state cal.setLenient(false); System.out.println("Lenient after setting :" + cal.isLenient()); } }