Period ofDays() method in Java with Examples
The ofDays() method of Period Class is used to obtain a period from given number of Days as parameter. This parameter is accepted in the form of integer. This method returns a Period with the given number of days.
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.
public static Period ofDays(int numberOfDays)
Parameters: This method accepts a single parameter numberOfDays which is the number of Days to be parsed into an Period object.
Returns: This function returns the period which is the Period object parsed with the given number of Days.
Below is the implementation of Period.ofDays() method:
0 Years 0 Months 5 Days
0 Years 0 Months -5 Days