java.time.MonthDay.isAfter() 方法
描述
java.time.MonthDay.isAfter(MonthDay other) 方法检查该月日是否在指定月日之后。
声明
以下是 java.time.MonthDay.isAfter(MonthDay other) 方法的声明。
public boolean isAfter(MonthDay other)
参数
other − 要比较的另一个月份,不为空。
返回值
如果这个月日在指定月日之后,则为真。
示例
下面的例子展示了 java.time.MonthDay.isAfter(MonthDay other) 方法的使用。
package com.tutorialspoint;
import java.time.MonthDay;
public class MonthDayDemo {
public static void main(String[] args) {
MonthDay date = MonthDay.parse("--12-30");
MonthDay date1 = MonthDay.parse("--12-20");
System.out.println(date1.isAfter(date));
}
}
让我们编译并运行上面的程序,这将产生下面的结果 −
false

