可学答题网 > 问答 > SCJP程序员认证考试题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

Given:   1.d is a


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?()

  • ALocale loc = Locale.getLocale(); System.out.println(loc.getDisplayCountry()+ " " + df.format(d));
  • BLocale loc = Locale.getDefault(); System.out.println(loc.getDisplayCountry()+ " " + df.format(d));
  • CLocale loc = Locale.getLocale();System.out.println(loc.getDisplayCountry()+ " " + df.setDateFormat(d));
  • D Locale loc = Locale.getDefault();System.out.println(loc.getDisplayCountry()+ " " + df.setDateFormat(d));
参考答案
参考解析:
分类:SCJP程序员认证考试题库