java.time.Duration.negated() 方法示例 java.time.Duration.multipliedBy() 方法示例 java.time.Duration.of() 方法示例 java.time.Duration.negated() 方法示例 package com.codingdict; import java.time.Duration; public class DurationDemo { public static void main(String[] args) { Duration duration = Duration.ofSeconds(5); System.out.println(duration.getSeconds()); Duration duration1 = duration.negated(); System.out.println(duration1.getSeconds()); } } java.time.Duration.multipliedBy() 方法示例 java.time.Duration.of() 方法示例