В строке Instant.MAX.toEpochMilli()
Это баг самой java?
package com.javarush.task.pro.task16.task1614;
import java.time.Instant;
public class Solution {
public static void main(String[] args) {
System.out.println(getMaxFromMilliseconds());
System.out.println(getMaxFromSeconds());
System.out.println(getMaxFromSecondsAndNanos());
}
static Instant getMaxFromMilliseconds() {
return Instant.ofEpochMilli(Instant.MAX.toEpochMilli());
}
static Instant getMaxFromSeconds() {
return Instant.ofEpochSecond(Instant.MAX.getEpochSecond());
}
static Instant getMaxFromSecondsAndNanos() {
return Instant.ofEpochSecond(Instant.MAX.getEpochSecond(), Instant.MAX.getNano());
}
}