
- java.time 包類
- java.time - 簡介
- java.time - 時鐘
- java.time - 持續時間
- java.time - 時間點
- java.time - 本地日期
- java.time - 本地時間
- java.time - 本地時間戳
- java.time - 月日
- java.time - 偏移日期時間
- java.time - 偏移時間戳
- java.time - 期間
- java.time - 年份
- java.time - 年月
- java.time - 時區日期時間
- java.time - 時區識別符號
- java.time - 時區偏移量
- java.time 包列舉
- java.time - 月份
- java.time 實用資源
- java.time - 討論
java.time.MonthDay.isAfter() 方法示例
描述
java.time.MonthDay.isAfter(MonthDay other) 方法檢查此月日是否在指定月日之後。
宣告
以下是 java.time.MonthDay.isAfter(MonthDay other) 方法的宣告。
public boolean isAfter(MonthDay other)
引數
other - 要比較的另一個月日,非空。
返回值
如果此月日在此指定月日之後,則返回 true。
示例
以下示例演示了 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
廣告