多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

Given:   1.d is a valid, non-null Date object   2.df is a valid, non-null DateFormat object set to the current locale    What outputs the current locale’s country name and the appropriate version of d’s date?()

  • A、Locale loc = Locale.getLocale(); System.out.println(loc.getDisplayCountry()+ " " + df.format(d));
  • B、Locale loc = Locale.getDefault(); System.out.println(loc.getDisplayCountry()+ " " + df.format(d));
  • C、Locale loc = Locale.getLocale();System.out.println(loc.getDisplayCountry()+ " " + df.setDateFormat(d));
  • D、 Locale loc = Locale.getDefault();System.out.println(loc.getDisplayCountry()+ " " + df.setDateFormat(d));
正确答案:B
答案解析:
进入题库查看解析

微信扫一扫手机做题