Period minusDays() method in Java with Examples
The minusDays() method of Period class in Java is used to subtract the days from this Period. This functions operates only on DAYS and does not affect YEAR and MONTH.
public Period minusDays(long daysToSubtract)
Parameters: This method accepts a single parameter daysToSubtract which is the number of days to be subtracted from the period.
Return Value: This method returns a Period based on provided period in the input
subtracting the specified number of days. It must not be null.
Exceptions: It throws an ArithmeticException. This exception is caught if numeric overflow occurs.
Below programs illustrate the above method:
My Personal Notes arrow_drop_up
Please Login to comment...