YearMonth isBefore(YearMonth other)
check if this year-month is
before the specified year-month.
isBefore
has the following syntax.
public boolean isBefore(YearMonth other)
The following example shows how to use isBefore
.
import java.time.YearMonth; public class Main { public static void main(String[] args) { YearMonth y = YearMonth.now(); System.out.println(y.isBefore(YearMonth.now())); } }
The code above generates the following result.