博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
java isset_Java Calendar isSet()方法与示例
阅读量:2538 次
发布时间:2019-05-11

本文共 1717 字,大约阅读时间需要 5 分钟。

java isset

日历类isSet()方法 (Calendar Class isSet() method)

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

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

  • isSet() method is used to test whether the given field of this calendar is set or not it returns true when the given parameter (fi) has been set by internal field interpretations.

    isSet()方法用于测试是否已设置此日历的给定字段,当内部字段解释已设置给定参数(fi)时,它返回true。

  • isSet() 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.

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

  • isSet() method does not throw an exception at the time of checking the given field is set.

    在检查给定字段设置时, isSet()方法不会引发异常。

Syntax:

句法:

public final boolean isSet(int fi);

Parameter(s):

参数:

  • int fi – represents the calendar field(fi) to be tested.

    int fi –代表要测试的日历字段(fi)。

Return value:

返回值:

The return type of the method is boolean, it returns true when the given calendar field is set otherwise it returns false.

方法的返回类型为boolean ,当设置给定日历字段时返回true,否则返回false。

Example:

例:

// Java Program to demonstrate the example of// boolean isSet(int fi) method of Calendarimport java.util.*;public class IsSet {
public static void main(String args[]) {
// Instantiating a Calendar object Calendar ca = Calendar.getInstance(); System.out.println("ca =" + ca.getTime()); // By using isSet(int fi) method is to // check the given field is set or // not of this Calendar boolean status = ca.isSet(Calendar.MONTH); //Display status System.out.println("ca.isSet(Calendar.MONTH): " + status); }}

Output

输出量

ca =Mon Jan 27 08:38:21 GMT 2020ca.isSet(Calendar.MONTH): true

翻译自:

java isset

转载地址:http://vwozd.baihongyu.com/

你可能感兴趣的文章
linux 系统下 tar 的压缩与解压缩命令
查看>>
阿里负载均衡,配置中间证书问题(在starcom申请免费DV ssl)
查看>>
转:How to force a wordbreaker to be used in Sharepoint Search
查看>>
MySQL存储过程定时任务
查看>>
Python中and(逻辑与)计算法则
查看>>
POJ 3267 The Cow Lexicon(动态规划)
查看>>
设计原理+设计模式
查看>>
音视频处理
查看>>
tomcat 7服务器跨域问题解决
查看>>
前台实现ajax 需注意的地方
查看>>
Jenkins安装配置
查看>>
个人工作总结05(第二阶段)
查看>>
Java clone() 浅拷贝 深拷贝
查看>>
深入理解Java虚拟机&运行时数据区
查看>>
02-环境搭建
查看>>
spring第二冲刺阶段第七天
查看>>
搜索框键盘抬起事件2
查看>>
阿里百川SDK初始化失败 错误码是203
查看>>
透析Java本质-谁创建了对象,this是什么
查看>>
BFS和DFS的java实现
查看>>