The instance method of the Calendar setlenient (boolean bool) is used to set its fault tolerance
Calendar Two modes:lenient mode and no-lenient mode, when calendar is in lenient mode, Each time field can accept values that exceed its allowable range. When in no-lenient mode, the program throws an exception when the value set by a time field exceeds the range it allows.
Set method Deferred Modification
The set (F,value) method changes the Calendar field F to value, and it also sets an internal member variable to indicate that the Calendar field has been modified. Even though the Calendar field F is modified immediately, the time represented by calendars is not immediately modified. Knowing that the next call to get (), GetTime (), Gettimeinmillis (), add (), Roll () will recalculate the time, which is called the delay modification of the set method, the advantage of deferred modification is that multiple calls Set() does not trigger multiple unnecessary computations
And look back on the 14th day of Java