下列关于java.util.Date类的描述中,错误的是?()
A. 无参的构造方法Date(),用来创建当前日期时间的Date对象
B. 在JDK的java.util包中提供了一个Date类用于表示日期和时间
C. 推荐使用Date(int year,int month,int date)构造方法来创建Date对象
D. 接收一个long型参数date的构造方法Date(long date),用于创建指定时间的Date对象
查看答案
下列方法中,用于返回当前日期的方法是?( )
A. Date()
B. Date(int year, int month, int date)
C. Date(String s)
Date(long date)
下列关于Date类的描述中,错误的是?( )
A. Date类获取的时间是以1970年1月1日0时0分0秒开始计时的
B. 在JDK1.1之后,Date类逐渐被Calendar类取代
C. Date类中大部分构造方法都被声明为已过时
Date类中大部分方法依然推荐使用
假设今天为2004年12月16日,以下代码的输出结果正确的是?( )public class FormatDateTime {public static void main(String[] args) { Date now = new Date();SimpleDateFormat myFmt=newSimpleDateFormat(“yyyy年MM月dd日 HH时mm分ss秒”); System.out.println(myFmt.format(now));} }
A. 2004年12月16日 17时24分27秒 星期四
B. 2004-12-16 17:24:27
C. 一年中的第351天一年中第51个星期一月中第3个星期在一天中17时CST时区
D. 2004年12月16日 17时24分27秒
下列方法中,哪个方法可以返回指定日历字段的值?()
A. void add(int field,int amount)
B. void set(int field,int value)
C. int get(int field)
D. void set(int year,int month,int date)