Java Instant isBefore() methodThe isBefore() method of Java Instant class is used to check if the instant is before the specified instant. SyntaxParametersotherInstant- The other instant to compare to, not null. ReturnTrue, if this instant is after the specified instant. ExceptionsNullPointerException - If otherInstant is null. Example 1Output: The output will be like this. Instant 1: 2017-02-03T10:37:30Z Instant 2: 2017-03-03T10:37:30Z Instant 1 is not after as Instant 2. Example 2Output: The output will be like this. 2017-05-01T20:57:49.381Z 2016-12-03T10:15:30Z false Next TopicJava-instant-isafter-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India