Java Date Time - Period ZERO example








Period ZERO defines a constant for a period of zero.

Syntax

ZERO has the following syntax.

public static final Period ZERO

Example

The following example shows how to use ZERO.

import java.time.Period;
/* ww  w  .j  a v  a2s  .co m*/
public class Main {
  public static void main(String[] args) {
    
    Period p = Period.ZERO;

    System.out.println(p.toString());

  }
}

The code above generates the following result.