java日历类add方法

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

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

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

  • setMinimalDaysInFirstWeek() method is used to set a minimum number of days needed in the first week of the year.

    setMinimalDaysInFirstWeek()方法用于设置一年的第一周所需的最少天数。

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

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

  • setMinimalDaysInFirstWeek() method does not throw an exception at the time of the set of minimum days needed in the first week of the year.

    setMinimalDaysInFirstWeek()方法在一年的第一周中所需的一组最少天数时不会引发异常。

Syntax:

句法:

    public void setMinimalDaysInFirstWeek(int days);

Parameter(s):

参数:

  • int days – represents the numeric value to set the number of days needed in the first week of the year.

    int days –表示用于设置一年中第一周所需天数的数值。

Return value:

返回值:

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

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

Example:

例:

// Java Program to demonstrate the example of
// void setMinimalDaysInFirstWeek(int days) method
// of Calendar
import java.util.*;
public class SetMinimalDayInFirstWeek {public static void main(String args[]) {// Instantiating a Calendar object
Calendar ca = Calendar.getInstance();
System.out.println("ca: " + ca.getTime());
// By using setMinimalDaysInFirstWeek(int) method is to
// set the minimum number of days in the first week of
// Calendar
ca.setMinimalDaysInFirstWeek(5);
// By using getMinimalDaysInFirstWeek() method is to
// return the minimal days required to complete first
// week of the calendar
int min_days = ca.getMinimalDaysInFirstWeek();
// Display status
System.out.println("ca.getMinimalDaysInFirstWeek(): " + min_days);
}
}

Output

输出量

ca: Sun Feb 02 08:31:30 GMT 2020
ca.getMinimalDaysInFirstWeek(): 5

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

java日历类add方法

java日历类add方法_Java日历setMinimalDaysInFirstWeek()方法与示例相关推荐

  1. java日历类add方法_Java日历computeTime()方法及示例

    java日历类add方法 日历类computeTime()方法 (Calendar Class computeTime() method) computeTime() method is availa ...

  2. java日历类add方法_Java日历computeFields()方法及示例

    java日历类add方法 日历类的computeFields()方法 (Calendar Class computeFields() method) computeFields() method is ...

  3. java日历类add方法_Java日历setFirstDayOfWeek()方法与示例

    java日历类add方法 日历类setFirstDayOfWeek()方法 (Calendar Class setFirstDayOfWeek() method) setFirstDayOfWeek( ...

  4. java中日历类的用法_java日期类的用法

    java日期类的用法 不管你是处理财务交易还是计划着下一步的行动,你都要知道怎样在Java中建立,使用和显示日期.这需要你简单的查阅一下相应类的API参考:一个日期可以创建3个相关类的对象.这篇文章告 ...

  5. java 获取类的注解_Java 自定义注解通过反射获取类、方法、属性上的注解

    反射 JAVA中的反射是运行中的程序检查自己和软件运行环境的能力,它可以根据它发现的进行改变.通俗的讲就是反射可以在运行时根据指定的类名获得类的信息. 注解的定义 注解通过 @interface 关键 ...

  6. java的lookup方法_Java ObjectStreamClass lookup()方法与示例

    ObjectStreamClass类lookup()方法lookup()方法在java.io包中可用. lookup()方法用于查找可以序列化的类的描述符. lookup()方法是静态方法,可以使用类 ...

  7. java实体类实现抽象类_java接口、抽象类、实体类关系介绍

    接口:接口是一个引用类型,与类相似,不过在接口中只能包含常量,方法名和嵌套类型.没有构造器,所以不能被实例化只能被类所实现或者被另外的接口所继承.在接口中声明的方法没有方法体. 抽象类:将类层次中共有 ...

  8. java方法重载和重载方法_Java中的方法重载

    java方法重载和重载方法 The concept of Method Overloading in Java is where a class can have multiple methods w ...

  9. Java 编程问题:七、Java 反射类、接口、构造器、方法和字段

    原文:Java Coding Problems 协议:CC BY-NC-SA 4.0 贡献者:飞龙 本文来自[ApacheCN Java 译文集],自豪地采用谷歌翻译. 本章包括涉及 Java 反射 ...

最新文章

  1. form submit firefox not working
  2. 苹果Q1财报出炉:手机收入下滑15%,服务收入增长19%
  3. javascript --- 在linux上部署项目
  4. 【ES10(2019)】JSON扩展 superset / stringify() 增强能力
  5. 厉害了!Spring Boot 2.5正式发布
  6. ubuntu mysql双主热备配置_MySql双主热备配置
  7. ARM 中断状态和SVC状态的堆栈切换 (异常)【转】
  8. appender log4j 扩展_详解Tomcat使用Log4j输出catalina.out日志
  9. JAVA集合系列(6):HashMap
  10. Android 图片高斯模糊处理
  11. 三菱Q PLC解密 用户名功能块FB破解
  12. vs各个版本的编译器号
  13. 郝斌C语言开篇 C语言简介
  14. echarts中的自定义tooltips
  15. [geoserver] appears to have started a thread named [FileSystemWatcher-1] but has failed to stop it.
  16. flink Too many fields referenced from an atomic type
  17. python解决经典数学问题-用python解决普通高中数学书A必修三题目(一)
  18. 枚举----暴力枚举
  19. 第一次使用梅花雨日历控件
  20. 零基础入门黑客教程(普通人成为黑客的10个步骤)

热门文章

  1. matlab knnsearchidx,matlab查找最临近搜索knnsearch
  2. java备份还原mysql数据库_Java备份还原Mysql数据库
  3. 一次打卡软件的实战渗透测试
  4. html5着陆页模板,多用途着陆页HTML模板
  5. html的过渡属性,CSS3属性transition(过渡)多属性详解
  6. excel文件导入hive乱码_将excel中的数据导入hive
  7. 数据库设置_CentOS7 - 设置MySQL数据库
  8. linux课堂笔记(8)
  9. php 递归栏目名叠加,thinkPHP实现递归循环栏目并按照树形结构无限极输出的方法,thinkphp递归...
  10. CentOS7下Hive的安装配置