java.util.Calendar isWeekDateSupported()方法

java.util.Calendar.isWeekDateSupported() 方法返回布尔值。它检查此日历是否支持星期日期。默认值为false。

1 语法

public boolean isWeekDateSupported()  

2 参数

3 返回值

返回布尔值。

4 示例1 

package com.yiidian;

/**
 * 一点教程网: http://www.yiidian.com
 */
/**
 * java.util.Calendar isWeekDateSupported()方法的例子
 */
import java.util.Calendar;  
public class JavaCalendarisWeekDateSupportedExample1 {  
    public static void main(String[] args) {  
                // creating a Calendar Object calobj  
        Calendar calobj = Calendar.getInstance();  
                System.out.println(" week date  :" + calobj.get(Calendar.DAY_OF_WEEK));  
        boolean c = calobj.isWeekDateSupported();  
        System.out.println("Is  week date supported :"  + c);  
                System.out.println("after clearing week date:");  
                calobj.clear();  
                 System.out.println(" week date  :" + calobj.get(Calendar.DAY_OF_WEEK));  
                c = calobj.isWeekDateSupported();  
        System.out.println("Is  week date supported :"  + c);  
    }  
} 

输出结果为:

Current Date and Time is Mon Aug 13 21:24:01 PDT 2018
Interpretation is lenient: true
NOW Date and Time is Mon Nov 11 21:24:01 PST 1996
Interpretation is lenient: true

 

热门文章

优秀文章