Period ZERO example

Description

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;
/*from  w  w w . ja v a 2  s . c om*/
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.





















Home »
  Java Date Time »
    java.time Reference »




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