题目内容

下面哪个赋值语句是错误的?

A. int i = (short)3;
B. int i = new Integer(5).intValue();
C. int i = (integer)3;
D. int i = (int)3.14;

查看答案
更多问题

要创建一个系统默认时区的当前日期LocalDate对象,下面哪个是合法的?

A. LocalDate today = new LocalDate();
B. LocalDate today = LocalDate.now();
C. LocalDate today = LocalDate.of();
D. LocalDate today = LocalDate.date();

写一个语句创建当前系统默认的本地日期对象,正确的是___________。

A. LocalDate today = new LocalDate();
B. LocalDate today = LocalDate.today();
C. LocalDate today = LocalDate.now();
D. LocalDate today = new MyDate();

给定日期对象today,要得到该日期是星期几,下面表达式正确的是___________。

A. today.getWeek()
B. today.getDayOfWeek()
C. today.getDay()
D. today.getDayOMonth()

若创建19:30:40时间,语句应该如何写_____________。

A. LocalTime.now()
B. new LocalTime(19,30,40)
C. LocalTime.now(19,30,40)
D. LocalTime.of(19,30,40)

答案查题题库