java calendar_Java Calendar getLeastMaximum()方法与示例

java calendar

Calendar类的getLeastMaximum()方法 (Calendar Class getLeastMaximum() method)

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

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

  • getLeastMaximum() method is used to get the least maximum value of the given field(fi) of this Calendar.

    getLeastMaximum()方法用于获取此Calendar的给定字段(fi)的最小值。

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

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

  • getLeastMaximum() method does not throw an exception at the time of returning the least maximum value.

    返回最小最大值时, getLeastMaximum()方法不会引发异常。

Syntax:

句法:

    public abstract int getLeastMaximum(int fi);

Parameter(s):

参数:

  • int fi – represents the field(fi) of this Calendar.

    int fi –表示此日历的字段(fi)。

Return value:

返回值:

The return type of the method is int, it returns the least maximum value of the given field (fi) of this Calendar.

方法的返回类型为int ,它返回此Calendar的给定字段(fi)的最小值。

Example:

例:

// Java Program to demonstrate the example of
// int getLeastMaximum(int fi) method of Calendar
import java.util.*;
public class GetLeastMaximum {
public static void main(String args[]) {
// Instantiating a Calendar object
Calendar ca = Calendar.getInstance();
// Display current calendar
System.out.println("ca: " + ca.getTime());
// By using getLeastMaximum(int fi) method is
// to return the least maximum value of the given field
int month = ca.getLeastMaximum(Calendar.MONTH);
//Display least maximum value of month
System.out.println("ca.getLeastMaximum(Calendar.MONTH): " + month);
}
}

Output

输出量

ca: Mon Jan 27 07:32:06 GMT 2020
ca.getLeastMaximum(Calendar.MONTH): 11

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

java calendar

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

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

相关文章

Shell 标准输入、输出和错误

防伪码:桃花潭水深千尺,不及汪伦送我情。文件描述符(fd):文件描述符是一个非负整数,在打开现存文件或新建文件时,内核会返回一个文件描述符,读写文件也需要使用文件描述符来访问文件…

java需要会的工具_Java开发者必备的几款工具,一定要掌握!

原标题:Java开发者必备的几款工具,一定要掌握!NotepadNotepad是用于编辑xml、脚本以及记笔记的最佳工具。这个工具的最好部分在于,你在Notepad上打开的任何一个文档,在关闭后都会有一个残留文档,它有助于在…

java的equals方法_Java LocalDateTime类| 带示例的equals()方法

java的equals方法LocalDateTime类equals()方法 (LocalDateTime Class equals() method) equals() method is available in java.time package. equals()方法在java.time包中可用。 equals() method is used to check whether this date-time and the given object are equal or…

portlet java_Java Portlet 规范概述

前言1、portlet是一种类似servlet的规范。2、servlet是web组件,portlet也是web组件。参考1、百度百科:portlethttp://baike.baidu.com/link?urlvMzVwpkf5WzOL23GLkgM4C5C7Sarqh1XXShS73L7k-MbGgM0ooZ4Dl2Efor3bb4tZmmLo6v-muG5UW7_CYMTUahttp://hintcnu…

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

LocalDate类minusWeeks()方法 (LocalDate Class minusWeeks() method) minusWeeks() method is available in java.time package. minusWeeks()方法在java.time包中可用。 minusWeeks() method is used to subtract the given weeks from this LocalDate and return the LocalD…

Android推荐的几本书

2019独角兽企业重金招聘Python工程师标准>>> 第一阶段 <<第一行代码Android>><<疯狂Android>>第二阶段 <<Android开发艺术探索>><<Android群英传>>Android源码 第三阶段 <<Android开发艺术探索>><&…

java数据类型后缀_java基础知识---基本数据类型

1)四种整数类型(byte、short、int、long)&#xff1a;byte&#xff1a;8 位&#xff0c;用于表示最小数据单位&#xff0c;如文件中数据&#xff0c;-128~127short&#xff1a;16 位&#xff0c;很少用&#xff0c;-32768 ~ 32767int&#xff1a;32 位、最常用&#xff0c;-2^3…

duration java_Java Duration类| minusMillis()方法与示例

duration java持续时间类minusMillis()方法 (Duration Class minusMillis() method) minusMillis() method is available in java.time package. minusMillis()方法在java.time包中可用。 minusMillis() method is used to subtract the given duration in milliseconds from t…

Thread 和 Runnable创建新线程的区别,Runnable可以共享线程类的实例属性

Thread实现多线程&#xff1a; public class Thread2 extends Thread{ public int i; public void run(){ for(; i < 100 ;i) { System.out.println(getName() " " i); } } public static void main(String[] args){ for (int j 0; j < 100; j) { System…

java编程求最小公约数_java求最大公约数与最小公倍数

public class Gongyueshu{public static void main(String[] args){//从控制台输入两个数据int m Integer.parseInt(args[0]);int n Integer.parseInt(args[1]);int y 1 ;int b 1;if (m > 0 && n >0){//先判定这两个数是否为倍数关系&#xff0c;如果是则小数…

tdr上升时间什么设定_TDR的完整形式是什么?

tdr上升时间什么设定TDR&#xff1a;时域反射仪/车票寄存收据/定期存款收据 (TDR: Time Domain Reflectometer/ Ticket Deposit Receipt/ Term Deposit Receipt) 1)TDR&#xff1a;时域反射仪 (1) TDR: Time Domain Reflectometer) TDR is an abbreviation of the "Time D…

【java】反射+poi 导出excel

2019独角兽企业重金招聘Python工程师标准>>> 反射 导出的数组转变成对象 private static Object expexcelMaptobean(Class<?> cobj,Map<String,String> map,int[] expColums,String[] params) throws InstantiationException, IllegalAccessException…

css设置背景图片大小_如何使用CSS设置背景图片大小?

css设置背景图片大小Introduction: 介绍&#xff1a; As we all know that the images are a very responsive yet very creative way to display your web page or website to the users. The images also play a major role in indulging users to websites or web pages. T…

java gc的特性_Java12新特性 -- 可中断的G1 Mixed GC

Java 12 中增强了 G1 垃圾收集器关于混合收集集合的处理策略&#xff0c;这节主要介绍在 Java 12 中同时也对 G1垃圾回收器进行了改进&#xff0c;使其能够在空闲时自动将 Java 堆内存返还给操作系统&#xff0c;这也是 Java 12 中的另外一项重大改进。目前 Java 11 版本中包含…

在Python3中将字符串转换为字节的最佳方法

To convert a string to bytes, there are more than one way, 要将字符串转换为字节&#xff0c;有多种方法&#xff0c; Approach 1: use encode() method 方法1&#xff1a;使用encode()方法 test_str "include_help"print(type(test_str))test_bytes test_st…

【Java】PMD规则学习(1) --字符串比较

PMD是一款采用BSD协议发布的Java程序代码检查工具。该工具可以做到检查Java代码中是否含有未使用的变量、是否含有空的抓取块、是否含有不必要的对象等。该软件功能强大&#xff0c;扫描效率高&#xff0c;是Java程序员debug的好帮手。 PMD支持的编辑器包括&#xff1a;JDevelo…

php定义object数据类型,PHP数据类型(4):对象object

//创建一个类class Student{//定义属性public $name XuGZh;public $age 20;public $sex 男;//定义方法public function getInfo(){//当前对象中访问自己属性用伪变量$thisreturn my name:.$this->name..my age:.$this->age..my sex:.$this->sex;}}对象初始化:要创建…

avr计数_使用8位LCD创建计数器| AVR

avr计数This type of counter may be also used in the EVM machines. A counter can be used to count the number of times a button is pressed. It can have many applications. The most widely used counter application is in EVM and also in customer feedback machin…

php将字符变为数字,数字字符怎么转化为数字 php 怎么将字符转成数字

java中&#xff0c;String字符串转化为数字我现在想把一个String字符串转化为数字&#xff0c; String s"00000123" 我直接使java中String字符串转化为数字&#xff1a; 转换为浮点型&#xff1a; 使用Double或者Float的parseDouble或者parseFloat方法进行转换 Strin…

用U盘作为启动盘做系统步骤

步骤一&#xff1a;BIOS设置U盘启动 制作好Win10 U盘系统安装盘之后&#xff0c;我们需要在电脑的BIOS设置中把第一启动设备设置为U盘&#xff0c;设置后就可以从我们制作的Win10 U盘系统安装盘启动&#xff0c;从而显示系统安装界面开始安装系统。BIOS设置U盘启动的方法如下&a…