LocalTime isBefore(LocalTime other) example
Description
LocalTime isBefore(LocalTime other)
checks if this LocalTime is before the specified time.
Syntax
isBefore
has the following syntax.
public boolean isBefore(LocalTime other)
Example
The following example shows how to use isBefore
.
import java.time.LocalTime;
// w ww. j a va2s . co m
public class Main {
public static void main(String[] args) {
LocalTime l = LocalTime.now();
System.out.println(l.isBefore(LocalTime.NOON));
}
}
The code above generates the following result.