java.time.Duration.equals() 方法示例


java.time.Duration.equals() 方法示例

package com.codingdict;

import java.time.Duration;
import java.time.LocalTime;

public class DurationDemo {
   public static void main(String[] args) {

      Duration duration = Duration.between(LocalTime.NOON,LocalTime.MAX);
      Duration duration1 = Duration.between(LocalTime.NOON,LocalTime.MIN);
      System.out.println(duration.equals(duration1));
   }
}