java calendar

Calendar类after()方法 (Calendar Class after() method)

  • after() method is available in java.util package.

    after()方法在java.util包中可用。

  • after() method is used to check whether this calendar time is after the time denoted by the given Object's time or not.

    after()方法用于检查此日历时间是否在给定Object的时间所表示的时间之后。

  • after() method is a non-static method, it is accessible with the class object and if we try to access the method with the class name then we will get an error.

    after()方法是一种非静态方法,可通过类对象访问,如果尝试使用类名称访问该方法,则会收到错误消息。

  • after() method does not throw an exception at the checking this calendar time with the given time.

    after()方法在检查给定时间的日历时间时不会引发异常。

Syntax:

句法:

    public boolean after(Object time);

Parameter(s):

参数:

  • Object time – represents the time to be compared with this calendar time.

    对象时间 –表示要与此日历时间进行比较的时间。

Return value:

返回值:

The return type of the method is boolean, it returns true when the given time is before this calendar time otherwise it returns false.

方法的返回类型为boolean ,如果给定时间早于日历时间,则返回true ,否则返回false

Example:

例:

// Java Program to demonstrate the example of
// boolean after(Object) method of Calendar
import java.util.*;
public class AfterOfCalendar {public static void main(String[] args) {// Instantiating two Calendar object
Calendar curr_ca = Calendar.getInstance();
Calendar after_ca = Calendar.getInstance();
// By using add() method is to add the
// 10 months to the current calendar
after_ca.add(Calendar.MONTH, 10);
// Display current and after calendar
System.out.println("curr_ca.getTime(): " + curr_ca.getTime());
System.out.println("after_ca.getTime(): " + after_ca.getTime());
// By using after() method is to check
// the after_ca time is after the curr_ca
boolean status = after_ca.after(curr_ca);
//Display Result
System.out.println("after_ca.after(curr_ca): " + status);
}
}

Output

输出量

curr_ca.getTime(): Thu Jan 23 11:12:36 GMT 2020
after_ca.getTime(): Mon Nov 23 11:12:36 GMT 2020
after_ca.after(curr_ca): true

翻译自: https://www.includehelp.com/java/calendar-after-method-with-example.aspx

java calendar

java calendar_Java Calendar after()方法与示例相关推荐

  1. cdate在java中_Java Calendar.add方法代码示例

    本文整理汇总了Java中java.util.Calendar.add方法的典型用法代码示例.如果您正苦于以下问题:Java Calendar.add方法的具体用法?Java Calendar.add怎 ...

  2. java的gettime,java.util.Calendar.getTime()方法实例

    全屏 java.util.Calendar.getTime()方法返回一个Date对象,它表示此Calendar的时间值 声明 以下是java.util.Calendar.getTime()方法的声明 ...

  3. java散列法的运用实例,Java HashMap compute() 使用方法及示例

    Java HashMap compute() 使用方法及示例 Java HashMap compute()方法计算一个新值,并将其与哈希映射中的指定键相关联. compute()方法的语法为: has ...

  4. math的用法在java中的使用,Java Math cbrt() 使用方法及示例

    Java Math cbrt() 使用方法及示例 Java Math cbrt()方法返回指定数字的立方根. cbrt()方法的语法为: Math.cbrt(double num) 注意:cbrt() ...

  5. java arraylist 方法返回值,Java ArrayList get() 使用方法及示例

    Java ArrayList get() 使用方法及示例 Java ArrayList get()方法返回指定位置存在的元素. get()方法的语法为: arraylist.get(int index ...

  6. java calendar_Java Calendar internalGet()方法与示例

    java calendar 日历类internalGet()方法 (Calendar Class internalGet() method) internalGet() method is avail ...

  7. java calendar_Java Calendar complete()方法与示例

    java calendar Calendar类的complete()方法 (Calendar Class complete() method) complete() method is availab ...

  8. java calendar_Java Calendar getLeastMaximum()方法与示例

    java calendar Calendar类的getLeastMaximum()方法 (Calendar Class getLeastMaximum() method) getLeastMaximu ...

  9. java calendar_Java Calendar getDisplayNames()方法与示例

    java calendar 日历类的getDisplayNames()方法 (Calendar Class getDisplayNames() method) getDisplayNames() me ...

最新文章

  1. Mybatis遍历查询 ——foreach
  2. 12层也能媲美ResNet?YOLOv4一作邓嘉团队提出ParNet:非深度网络!
  3. Google 已正式结束对 Eclipse Android 的支持
  4. php redis 队列,Redis 实现队列
  5. 容器:开启应用微观时代
  6. Linq GroupJoin 使用
  7. 【Day03】使用原型最大的好处及原型链的理解
  8. Matlab Tricks(十四) —— 句柄(handle)(图形对象属性的读取与修改)
  9. is-is中通告默认路由
  10. kindle亚马逊个人文档不显示_Kindle的PC版如何看个人文档
  11. SM9学习笔记与图解(合集)
  12. 利用猜根法求解三阶行列式的特征值
  13. photoshop 安装和使用 蓝湖上传设计图
  14. clob informix java_informix如何插入clob
  15. linux 目录 问号 原因,linux – 如何修复所有问号作为权限的目录
  16. VBS整人蓝屏代码(Windows 7 直接蓝屏,重启即可恢复,亲测有效!!)
  17. Python分析A股市场财务报表经验总结
  18. 企业级无线渗透与无线数据浅析
  19. mysql数据库的多表查询(一对一,一对多,多对多)
  20. 【资源下载】2016第七届中国数据库技术大会圆满结束

热门文章

  1. python连接redis哨兵_Python redis.sentinel方法代码示例
  2. c语言计算机编程例题详解,计算机C语言编写程序题及答案解析精选.doc
  3. mysql中的生日应该是什么类型_MySQL中的定点数类型
  4. [2020-AAAI] Revisiting Image Aesthetic Assessment via Self-Supervised Feature Learning 论文简析
  5. linux非标准头文件,Linux学习:unix的标准化的实现(Linux中各种限制-数据类型-各种标准化头文件介绍)...
  6. python快速排序代码_Python实现快速排序算法
  7. java 按位_Java中的按位运算
  8. PL/SQL批处理语句:BULK COLLECT 和 FORALL
  9. 【差分数组】Master of GCD
  10. Java @Transient 注解使用