Java Date before() MethodThe before() method of Java Date class tests whether the date is before the specified date or not. Syntax:Parameterswhen - a date ReturnIt returns a Boolean value. It will return true if this date is before the specified date otherwise false. ExceptionNullPointerException will be thrown if when is null. Example 1Test it NowOutput: Date 'd' is before Date 'd2' : true Example 2Test it NowOutput: Date 'd' is before Date 'd2' : false
Next Topicjava.util.Date
|