setlenient

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

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

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

  • setLenient() method is used to set or unset lenient status of date or time interpretations.

    setLenient()方法用于设置或取消设置日期或时间解释的宽松状态。

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

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

  • setLenient() method does not throw an exception at the time of set lenient status.

    setLenient()方法在设置宽松状态时不会引发异常。

Syntax:

句法:

    public void setLenient(boolean status);

Parameter(s):

参数:

  • boolean status – represents the lenient status, it sets true when lenient status is on otherwise it sets false indicates lenient status is off.

    布尔状态 –表示宽容状态,当宽容状态打开时将其设置为true,否则将其设置为false表示宽容状态为关闭。

Return value:

返回值:

The return type of this method is void, it returns nothing.

此方法的返回类型为void ,不返回任何内容。

Example:

例:

// Java Program to demonstrate the example of
// void setLenient(boolean) method of Calendar
import java.util.*;
public class SetLenient {public static void main(String args[]) {// Instantiating a Calendar object
Calendar ca = Calendar.getInstance();
System.out.println("ca: " + ca.getTime());
// By using setLenient(boolean) method is to
// set the lenient status of the given Calendar
ca.setLenient(false);
// By using isLenient() method is to
// return the lenient status of the calendar
boolean status = ca.isLenient();
//Display status
System.out.println("ca.isLenient(): " + status);
}
}

Output

输出量

ca: Sun Feb 02 08:22:45 GMT 2020
ca.isLenient(): false

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

setlenient

setlenient_Java日历setLenient()方法与示例相关推荐

  1. html日历页面节假日_js+html制作简单日历的方法

    这篇文章主要为大家详细介绍了js html制作简单日历的方法,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下 新手一枚,不会写什么高大上的博文,一些平时做的小练习,献丑 ...

  2. 日历生成装置和日历生成方法

    摘要 本发明提供一种日历生成装置和一种日历生成方法.其中,日历生成装置包括:规则设置模块,设置用于生成日历的规则:指令生成模块,根据规则,生成用于生成日历的指令:日历生成模块,执行指令,以生成日历.通 ...

  3. .net连接mysql数据_.net连接MYSQL数据库的方法及示例!

    连接MYSQL数据库的方法及示例 方法一: 使用MYSQL推出的MySQL Connector/Net is an ADO.NET driver for MySQL 该组件为MYSQL为ADO.NET ...

  4. set.difference() 的用法(python3)_Python 集合 difference_update() 使用方法及示例

    Python 集合 difference_update() 使用方法及示例 Difference_update()使用集合的差集更新集合,并调用difference_update()方法. 如果A和B ...

  5. doc python 颜色_Python wordcloud.ImageColorGenerator方法代码示例

    本文整理汇总了Python中wordcloud.ImageColorGenerator方法的典型用法代码示例.如果您正苦于以下问题:Python wordcloud.ImageColorGenerat ...

  6. isdigit函数在C语言什么意思,C 库函数 isdigit() 使用方法及示例

    C 库函数 isdigit() 使用方法及示例 isdigit()函数检查字符是否为数字字符(0-9). isdigit()的函数原型int isdigit( int arg ); 函数isdigit ...

  7. python中append的用法_Python 列表 append() 使用方法及示例

    Python 列表 append() 使用方法及示例 append()方法将一个项目添加到列表的末尾. append()方法将单个项目添加到列表的末尾. append()方法的语法为:list.app ...

  8. java kryo_Kryo框架使用方法代码示例

    Kryo框架的source已移至https://github.com/EsotericSoftware/kryo ,进入此页面,然后点击右边的Download Zip按钮,就能下载到最新版本的Kryo ...

  9. python文件的用法,Python 文件 readlines() 使用方法及示例

    Python 文件 readlines() 使用方法及示例 概述 readlines() 方法用于读取所有行(直到结束符 EOF)并返回列表,该列表可以由 Python 的 for... in ... ...

最新文章

  1. 实战:Windows Server 2008 使用WSUS实现内网计算机系统更新
  2. RSS阅读器使用:ROME,Spring MVC,嵌入式Jetty
  3. Python编程一定要注意的那些“坑”(四)
  4. python脚本在centos系统一键卸载重新安装Mysql
  5. cent os 7 mysql_centos – 百胜:Cent OS 7中没有包mysql-server
  6. [转载]最小生成树-Prim算法和Kruskal算法
  7. 三岁小孩开发搜索引擎,搜索引擎白热化[原创]
  8. excel2010文件转换为 dbf 格式文件
  9. z77主板可以用nv_刚和吧友讨论了z77加装nvme固态的问题。在这重开一帖。
  10. con和com开头单词规律_这些背单词的弯路,你家孩子正在走吗?其实你可以...
  11. maven-resources-plugin:2.6:resources (default-resources)
  12. matlab构建boost电路,基于matlab的boost电路仿真.doc
  13. 解决多旅行商(MTSP)的分组遗传算法(GGA-SS)
  14. 《Linux内核修炼之道》精华分享与讨论(1)——缅怀已逝的十八年(1991~1998)
  15. pyltp依存句法分析_NLP(十二)依存句法分析的可视化及图分析
  16. [ Azure | Az-900 ] 基础知识点总结(二) - 核心组件服务
  17. 2022最新汉化camtasia studio电脑录制屏幕工具
  18. 伦敦旅游体验推荐:全英偶像之旅
  19. C#批量修改文件后缀
  20. 现场签约及达成合作意向金额6.8亿多元 山东104家企业闪耀第十五届“中博会”

热门文章

  1. linux 自动安装 yum,LINUX6安装YUM仓库和实现开机自动挂载
  2. 计算机应用能力考试ppt,计算机应用能力考试题库
  3. 查看oracle自动优化,使用索引查询更快,优化器为何不能自动识别
  4. canvas动画简单操作
  5. 微信小程序适配iphonex
  6. 【...】小程序扩展运算符 ... 说明
  7. js中split()和join()的用法
  8. 正确判断js数据类型 总结记录
  9. vue移动端项目缓存问题实践
  10. [译文]过犹不及,别再在编程中高射炮打蚊子