Courseiva

1Z0-829 Practice Question: Handling Date, Time, Text, Numeric and Boolean Values

Which two of the following are valid ways to create a LocalDate representing the current date in the system's default timezone? (Choose two.)

⚠ Common exam trap

A common mix-up: candidates assume `LocalDate.from(Instant.now())` should work because both are date/time types, but they fail to recognize that `Instant` lacks timezone and date fields, causing a runtime exception, while `new LocalDate()` is a common misconception from other Java classes that have public constructors.

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

LocalDate.now()

`LocalDate.now()` is the standard, straightforward method to obtain the current date in the system's default timezone, as defined in the Java Time API (JSR-310). It internally uses the system clock and the default timezone to return a `LocalDate` instance without requiring any additional parameters.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • LocalDate.from(Instant.now())

    Why it's wrong here

    Incorrect: from() requires a TemporalAccessor with date fields; Instant does not provide date.

  • new LocalDate()

    Why it's wrong here

    Incorrect: LocalDate has no public constructor.

  • LocalDate.now()

    Why this is correct

    Correct: Uses the system's default timezone.

  • LocalDate.ofEpochDay(System.currentTimeMillis() / (24*60*60*1000))

    Why it's wrong here

    Incorrect: This does not account for timezone offset and may produce wrong date near midnight.

  • LocalDate.ofInstant(Instant.now(), ZoneId.systemDefault())

    Why this is correct

    Correct: ofInstant method was added in Java 9 and works with default zone.

About these practice questions

Courseiva writes every 1Z0-829 question from scratch — 513 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.