Year isBefore(Year other) example
Description
Year isBefore(Year other)
checks if this year is
before the specified year.
Syntax
isBefore
has the following syntax.
public boolean isBefore(Year other)
Example
The following example shows how to use isBefore
.
import java.time.Year;
//ww w . j ava 2s. co m
public class Main {
public static void main(String[] args) {
Year y = Year.of(2014);
System.out.println(y.isBefore(Year.of(2015)));
}
}
The code above generates the following result.