nerdexam
Oracle

1Z0-805 · Question #4

Given the code fragment: SimpleDateFormat sdf; Oracle 1Z0-805 Exam Which code fragment displays the three-character month abbreviation?

The correct answer is C. sdf = new SimpleDateFormat ("MMM", Locale.UK). C: Output example: Apr Note:SimpleDateFormat is a concrete class for formatting and parsing dates in a locale-sensitive manner. It allows for formatting (date -> text), parsing (text -> date), and normalization. SimpleDateFormat allows you to start by choosing any user-defined…

Localization

Question

Given the code fragment:

SimpleDateFormat sdf; Oracle 1Z0-805 Exam Which code fragment displays the three-character month abbreviation?

Options

  • Asdf = new SimpleDateFormat ("mm", Locale.UK);
  • Bsdf = new SimpleDateFormat ("MM", Locale.UK);
  • Csdf = new SimpleDateFormat ("MMM", Locale.UK);
  • Dsdf = new SimpleDateFormat ("MMMM", Locale.UK);

How the community answered

(54 responses)
  • A
    7% (4)
  • B
    4% (2)
  • C
    78% (42)
  • D
    11% (6)

Explanation

C: Output example: Apr Note:SimpleDateFormat is a concrete class for formatting and parsing dates in a locale-sensitive manner. It allows for formatting (date -> text), parsing (text -> date), and normalization. SimpleDateFormat allows you to start by choosing any user-defined patterns for date-time formatting. However, you are encouraged to create a date-time formatter with either getTimeInstance, getDateInstance, orgetDateTimeInstance in DateFormat. Each of these class methods can return a date/time formatter initialized with a default format pattern. You may modify the format pattern using the applyPattern methods as desired.

Topics

#SimpleDateFormat#month format pattern#date formatting#Locale

Community Discussion

No community discussion yet for this question.

Full 1Z0-805 Practice