Hi there,
Over here is some information on the Instant class
https://docs.oracle.com/javase/tutorial/datetime/iso/instant.html
One of the examples given is:
Instant oneHourLater = Instant.now().plusHours(1);
However, when I try this code it does not compile. I do however see options in my IDE (Netbeans) for plusMillis, plusNanos, plusSeconds and plus, but not for plusHours.
Even when I try
java.time.Instant oneHourLater = java.time.Instant.now().plusHours(1);
to be absolutely sure of the right class used, it does not compile.
error: cannot find symbol
java.time.Instant oneHourLater = java.time.Instant.now().plusHours(1);
symbol: method plusHours(int)
location: class Instant
1 error
When I look into the code of Instant.java (once again in package java.time) I cannot find plusHours.
I must be missing something obvious here or the official Oracle tutorial is just... wrong...?