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…
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)- A7% (4)
- B4% (2)
- C78% (42)
- D11% (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
Community Discussion
No community discussion yet for this question.