Period ofWeeks(int weeks) example
Description
Period ofWeeks(int weeks)
creates a Period
representing a number of weeks.
Syntax
ofWeeks
has the following syntax.
public static Period ofWeeks(int weeks)
Example
The following example shows how to use ofWeeks
.
import java.time.Period;
//ww w . j a v a 2 s . com
public class Main {
public static void main(String[] args) {
Period p = Period.ofWeeks(12);
System.out.println(p.toString());
}
}
The code above generates the following result.