Java Date Time - Duration ZERO example








Duration ZERO Constant for a duration of zero.

Syntax

ZERO has the following syntax.

public static final Duration ZERO

Example

The following example shows how to use ZERO.

import java.time.Duration;

public class Main {
  public static void main(String[] args) {
    Duration duration = Duration.ZERO;
    System.out.println(duration);
  }
}

The code above generates the following result.