nerdexam
Oracle

1Z0-805 · Question #39

Given the code fragment: dataFormat df; Oracle 1Z0-805 Exam Which statement defines a new DataFormat object that displays the default date format for the UK Locale?

The correct answer is C. df = DateFormat.getDateInstance (DateFormat.DEFAULT, Locale.UK). 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…

Localization

Question

Given the code fragment:

dataFormat df; Oracle 1Z0-805 Exam Which statement defines a new DataFormat object that displays the default date format for the UK Locale?

Options

  • Adf = DateFormat.getDateInstance (DateFormat.DEFAULT, Locale(UK));
  • Bdf = DateFormat.getDateInstance (DateFormat.DEFAULT, UK);
  • Cdf = DateFormat.getDateInstance (DateFormat.DEFAULT, Locale.UK);
  • Ddf = new DateFormat.getDataInstance (DataFormat.DEFAULT, Locale.UK);
  • Edf = new DateFormat.getDateInstance (DateFormat.DEFAULT, Locale(UK));

How the community answered

(18 responses)
  • A
    6% (1)
  • B
    6% (1)
  • C
    78% (14)
  • D
    11% (2)

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 These are int constants defined by DateFormat.

Topics

#DateFormat#Locale#getDateInstance#localization API

Community Discussion

No community discussion yet for this question.

Full 1Z0-805 Practice