Duration ZERO example

Description

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;
//from www  .j  av a2s .c o m
public class Main {
  public static void main(String[] args) {
    Duration duration = Duration.ZERO;
    System.out.println(duration);
  }
}

The code above generates the following result.





















Home »
  Java Date Time »
    java.time Reference »




Clock
DayOfWeek
Duration
Instant
LocalDate
LocalDateTime
LocalTime
Month
MonthDay
OffsetDateTime
OffsetTime
Period
Year
YearMonth
ZonedDateTime
ZoneId
ZoneOffset