1Z0-829 Practice Question: Handling Date, Time, Text, Numeric and Boolean Values
Which TWO statements correctly use the DateTimeFormatter class? (Choose two.)
⚠ Common exam trap
Oracle often tests the confusion between static factory methods and instance methods, and the correct argument order for overloaded methods like `ofPattern()` and `ofLocalizedTime()`, leading candidates to incorrectly mix up parameter positions or call instance methods on static constants.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL);
`DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL)` is a valid static factory method that returns a formatter using the default locale's full date style. Option C is correct because `DateTimeFormatter.ofPattern("dd/MM/yyyy")` is the standard way to create a custom pattern-based formatter.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_DATE.ofPattern("yyyy-MM-dd");
Why it's wrong here
Incorrect: ISO_LOCAL_DATE is already a formatter.
- ✓
DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL);
Why this is correct
Correct: uses predefined format styles.
- ✓
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");
Why this is correct
Correct: uses pattern string.
- ✗
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(Locale.US, "yyyy-MM-dd");
Why it's wrong here
Incorrect: ofPattern takes pattern first, then optional Locale.
- ✗
DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedTime(Locale.US, FormatStyle.MEDIUM);
Why it's wrong here
Incorrect: ofLocalizedTime takes FormatStyle first, then Locale.
Go deeper
Related to this question
About these practice questions
This 1Z0-829 question is part of Courseiva's 513-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-829 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-829 exam.