java calendar_Java Calendar after()方法与示例
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()方法与示例相关推荐
- cdate在java中_Java Calendar.add方法代码示例
本文整理汇总了Java中java.util.Calendar.add方法的典型用法代码示例.如果您正苦于以下问题:Java Calendar.add方法的具体用法?Java Calendar.add怎 ...
- java的gettime,java.util.Calendar.getTime()方法实例
全屏 java.util.Calendar.getTime()方法返回一个Date对象,它表示此Calendar的时间值 声明 以下是java.util.Calendar.getTime()方法的声明 ...
- java散列法的运用实例,Java HashMap compute() 使用方法及示例
Java HashMap compute() 使用方法及示例 Java HashMap compute()方法计算一个新值,并将其与哈希映射中的指定键相关联. compute()方法的语法为: has ...
- math的用法在java中的使用,Java Math cbrt() 使用方法及示例
Java Math cbrt() 使用方法及示例 Java Math cbrt()方法返回指定数字的立方根. cbrt()方法的语法为: Math.cbrt(double num) 注意:cbrt() ...
- java arraylist 方法返回值,Java ArrayList get() 使用方法及示例
Java ArrayList get() 使用方法及示例 Java ArrayList get()方法返回指定位置存在的元素. get()方法的语法为: arraylist.get(int index ...
- java calendar_Java Calendar internalGet()方法与示例
java calendar 日历类internalGet()方法 (Calendar Class internalGet() method) internalGet() method is avail ...
- java calendar_Java Calendar complete()方法与示例
java calendar Calendar类的complete()方法 (Calendar Class complete() method) complete() method is availab ...
- java calendar_Java Calendar getLeastMaximum()方法与示例
java calendar Calendar类的getLeastMaximum()方法 (Calendar Class getLeastMaximum() method) getLeastMaximu ...
- java calendar_Java Calendar getDisplayNames()方法与示例
java calendar 日历类的getDisplayNames()方法 (Calendar Class getDisplayNames() method) getDisplayNames() me ...
最新文章
- Mybatis遍历查询 ——foreach
- 12层也能媲美ResNet?YOLOv4一作邓嘉团队提出ParNet:非深度网络!
- Google 已正式结束对 Eclipse Android 的支持
- php redis 队列,Redis 实现队列
- 容器:开启应用微观时代
- Linq GroupJoin 使用
- 【Day03】使用原型最大的好处及原型链的理解
- Matlab Tricks(十四) —— 句柄(handle)(图形对象属性的读取与修改)
- is-is中通告默认路由
- kindle亚马逊个人文档不显示_Kindle的PC版如何看个人文档
- SM9学习笔记与图解(合集)
- 利用猜根法求解三阶行列式的特征值
- photoshop 安装和使用 蓝湖上传设计图
- clob informix java_informix如何插入clob
- linux 目录 问号 原因,linux – 如何修复所有问号作为权限的目录
- VBS整人蓝屏代码(Windows 7 直接蓝屏,重启即可恢复,亲测有效!!)
- Python分析A股市场财务报表经验总结
- 企业级无线渗透与无线数据浅析
- mysql数据库的多表查询(一对一,一对多,多对多)
- 【资源下载】2016第七届中国数据库技术大会圆满结束
热门文章
- python连接redis哨兵_Python redis.sentinel方法代码示例
- c语言计算机编程例题详解,计算机C语言编写程序题及答案解析精选.doc
- mysql中的生日应该是什么类型_MySQL中的定点数类型
- [2020-AAAI] Revisiting Image Aesthetic Assessment via Self-Supervised Feature Learning 论文简析
- linux非标准头文件,Linux学习:unix的标准化的实现(Linux中各种限制-数据类型-各种标准化头文件介绍)...
- python快速排序代码_Python实现快速排序算法
- java 按位_Java中的按位运算
- PL/SQL批处理语句:BULK COLLECT 和 FORALL
- 【差分数组】Master of GCD
- Java @Transient 注解使用