Period ofWeeks(int weeks)
creates a Period
representing a number of weeks.
ofWeeks
has the following syntax.
public static Period ofWeeks(int weeks)
The following example shows how to use ofWeeks
.
import java.time.Period; //from w w w.j ava2 s . c o m 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.