1Z0-805 · Question #53
Given the code fragment: SimpleDateFormat sdf; Which code fragment displays the two-digit month number?
The correct answer is B. sdf = new SimpleDateFormat ("MM", Locale.UK). B: Output example (displays current month numerically): 04 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. Oracle 1Z0-805 Exam…
Question
Given the code fragment:
SimpleDateFormat sdf; Which code fragment displays the two-digit month number?
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
(20 responses)- A5% (1)
- B75% (15)
- C5% (1)
- D15% (3)
Explanation
B: Output example (displays current month numerically): 04 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. Oracle 1Z0-805 Exam 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.