Period isZero()
checks if all three units of this period are zero.
isZero
has the following syntax.
public boolean isZero()
The following example shows how to use isZero
.
import java.time.Period; /*from w w w . jav a 2 s.co m*/ public class Main { public static void main(String[] args) { Period p = Period.ofMonths(1); System.out.println(p.isZero()); } }
The code above generates the following result.