1Z0-805J Free Dumps Study Materials
Question 2: 次のコード? フラグメントはありま す:
dataFormat df;
どのステートメントは、 英国のロケールのデフォルトの日付書式を表示する新しいデータフ
ォーマットオブジェクトを定義しますか。
A. df = DateFormat.getDateInstance (DateFormat.DEFAULT, Locale(UK));
B. df = DateFormat.getDateInstance (DateFormat.DEFAULT, UK);
C. df = DateFormat.getDateInstance (DateFormat.DEFAULT, Locale.UK);
D. df = new DateFormat.getDataInstance (DataFormat.DEFAULT, Locale.UK);
E. df = new DateFormat.getDateInstance (DateFormat.DEFAULT, Locale(UK));
Correct Answer: C
Explanation:
DateFormat is an abstract class that provides the ability to format and parse dates
and times. The getDateInstance() method returns an instance of DateFormat that can format date
information. It is available in these forms:
static final DateFormat getDateInstance( )
static final DateFormat getDateInstance(int style)
static final DateFormat getDateInstance(int style, Locale locale)
The argument style is one of the following values: DEFAULT, SHORT, MEDIUM, LONG, or FULL.
These are int constants defined by DateFormat.