setlenient_Java日历setLenient()方法与示例

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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/378759.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

PowerShell_9_零基础自学课程_9_高级主题:静态类和类的操作

哈哈,昨天弄了个ubuntu 11.10在虚拟机上运行,发现11.10界面非常绚丽,但是其需要的系统资源非常多,我虚拟机设定内存为512M,1个CPU4个核心, 进入以后发现根本动不了,因此今天我就下载了一个Fedor…

05-图像的平滑处理(不同的滤波操作)

对图像进行平滑处理实则就是对图像进行滤波操作罢了 每张图片都有若干个像素点所构成,滤波操作上就是将照片上的某些部分像素点进行修改从而达到平滑的效果 先展示一下原图 import cv2 img cv2.imread(E:\Jupyter_workspace\study\data/test1.png)cv2.imshow(te…

js删除mysql记录_(DELETEUPDATE)修改、删除数据记录_MySQL

有时,希望除去某些记录或更改它们的内容。DELETE 和 UPDATE 语句令我们能做到这一点。用update修改记录UPDATE tbl_name SET 要更改的列WHERE 要更新的记录这里的 WHERE 子句是可选的,因此如果不指定的话,表中的每个记录都被更新。例如&#…

C++设计模式之Abstract Factory模式

一、功能   提供一个创建一系列相关或相互依赖对象的接口,而无需指定它们具体的类。 二、结构图类厂最基本的结构示意图如下: 在实际应用中,类厂模式可以扩充到很复杂的情况,如下图所示: 三、优缺点 优点&#xff1…

数字图像处理小练习存档1

小练习的题目: 1、读取一张图,分解RGB三个通道 /************练习1**********************/ int main() {Mat img1 imread("D:\\opencv_picture_test\\miku2.jpg",2|4); //灰度图if (img1.empty()){printf("Could not find the imag…

UIImage 压缩

1.改变图片大小 -(UIImage*)imageWithImage:(UIImage*)image scaledToSize:(CGSize)newSize {// Create a graphics image contextUIGraphicsBeginImageContext(newSize);// Tell the old image to draw in this new context, with the desired// new size[image drawInRect:CG…

06-对图像进行腐蚀操作

形态学中的腐蚀操作一般处理的图像数据为二值的 cv2.erode(img,kernel,iterations 1) kernel表示拿多大的卷积核去腐蚀 iterations表示迭代次数 可以将一些带有毛毛的图像去毛毛化 原图 import cv2 import numpy as npdef show_photo(name,picture):cv2.imshow(name,picture)…

Java BufferedReader skip()方法与示例

BufferedReader类skip()方法 (BufferedReader Class skip() method) skip() method is available in java.io package. skip()方法在java.io包中可用。 skip() method is used to skip the given number of bytes of characters (n_bytes_of_char) from this BufferedReader. s…

mysql gtid binlog_MySQL之-四步实现BinLog Replication升级为GTIDs Replication的代码实例

1、将Master和Slave服务器都设置为read-onlymysql>SET global.read_onlyON;2、将Master与Slave服务器都停下来service mysql stop3、开启GTIDs开启GTIDs需要在master和slave服务器上都配置gtid-mode,log-bin,log-slave-updates,enforce-gtid-consistency(在MySQL 5.6.9之前是…

【记】琐碎

1.GIF载入问题:http://www.cnblogs.com/Lewis/archive/2011/01/17/1937066.html 2.正则分段数字: "12345678945612456".replace(new RegExp((\\d)(?(\\d{3})$),ig),"$1,") 其中用到了正则的后则判断? 3.给legend设定宽度 发现IE下可以 火狐下…

spring对事务的控制 AOP

我解释一下(* com.evan.crm.service.*.*(..))中几个通配符的含义: |第一个 * —— 通配 任意返回值类型| |第二个 * —— 通配 包com.evan.crm.service下的任意class| |第三个 * —— 通配 包com.evan.crm.service下的任意class的任意方法| |第四个 .. —— 通配 方…

Opencv实现利用滑动条来调整阈值

#include <opencv2/opencv.hpp> #include <iostream>using namespace cv; using namespace std; #define WINDOW_NAME "【程序窗口】" //为窗口标题定义的宏 //*--------------------------【练习】利用滑动条来调整阈值-----------------------------…

07-对图像进行膨胀操作

形态学中的膨胀操作即让照片变得更大&#xff0c;与腐蚀操作互为逆运算 cv2.dilate(erosion,kernel,iterations 1) 第一个参数&#xff1a;图像对象名称 第二个参数&#xff1a;卷积核的大小 第三个参数&#xff1a;迭代次数 此时就可与腐蚀操作进行相结合&#xff0c;腐蚀去毛…

Java LocalDate类| parse()方法与示例

LocalDate类parse()方法 (LocalDate Class parse() method) Syntax: 句法&#xff1a; public static LocalDate parse(CharSequence c_seq);public static LocalDate parse(CharSequence c_seq, DateTimeFormatter fmtr);parse() method is available in java.time package. …

Xhtml学习笔记

1. XHTML 是什么&#xff1f; XHTML 指可扩展超文本标签语言&#xff08;EXtensible HyperText Markup Language&#xff09;。 XHTML 的目标是取代 HTML。 XHTML 与 HTML 4.01 几乎是相同的。 XHTML 是更严格更纯净的 HTML 版本。 XHTML 是作为一种 XML 应用被重新定义的 HTML…

08-开运算和闭运算

开运算和闭运算实则就是将腐蚀操作和膨胀操作结合而已&#xff0c;也就是个先后循序罢了 开运算&#xff1a;先腐蚀再膨胀 闭运算&#xff1a;先膨胀再腐蚀 cv2.morphologyEx(img_open,cv2.MORPH_OPEN,kernel) cv2.morphologyEx(img_close,cv2.MORPH_CLOSE,kernel) 第一个参数…

连通域标记——实现硬币自动计件

前言 在自动计算图像中有几枚硬币的任务中&#xff0c;分离出前景和背景后是否就可以马上实现自动计件&#xff0c;如果可以&#xff0c;如何实现&#xff1f;如果不可以&#xff0c;为什么&#xff1f; 答案是否定的。二值化之后我们的得到的只是前景总像素的多少&#xff0c…

Storm资料汇总

一、Storm集群安装部署 网上关于storm集群部署都大同小异。 Storm下载地址&#xff1a;http://storm-project.net Storm项目地址&#xff1a;https://github.com/nathanmarz/storm 目前的版本不支持ZooKeeper3.4.5版本&#xff0c;而支持ZooKeeper3.3.3版本。 我当时没注意这…

getlong_Java即时类| 带示例的getLong()方法

getlong即时类getLong()方法 (Instant Class getLong() method) getLong() method is available in java.time package. getLong()方法在java.time包中可用。 getLong() method is used to get the value as long for the given temporal field from this Instant. getLong()方…

python作品阐述_Python网络编程基础的作品鉴赏-

Python网络编程基础的作品鉴赏Python网络编佳入门图书&#xff01;175个完整&#xff0c;实践出真知&#xff0c;SocketsDNS、Web Service、FTP、Email、SMTP、POP、IMAP、SocketServe、CGI、XML、Forking、数据库客户端、多线程、异步通信……完整涵盖网络编程的方方面面“这可…