Courseiva
Knowledge + Practice
CertificationsVendorsCareer RoadmapsLabs & ToolsStudy GuidesGlossaryPractice Questions
C
Courseiva

Free IT certification practice questions with explained answers for CCNA, CompTIA, AWS, Azure, Google Cloud, and more.

Certification Practice Questions

CCNA practice questionsSecurity+ SY0-701 practice questionsAWS SAA-C03 practice questionsAZ-104 practice questionsAZ-900 practice questionsCLF-C02 practice questionsA+ Core 1 practice questionsGoogle Cloud ACE practice questionsCySA+ CS0-003 practice questionsNetwork+ N10-009 practice questions
View all certifications →

Product

CertificationsCertification PathsExam TopicsPractice TestsExam Dumps vs Practice TestsStudy HubComparisons

Company

AboutContactEditorial PolicyQuestion Writing PolicyTrust Center

Legal

Privacy PolicyTerms of Service

Courseiva is a free IT certification practice platform offering original exam-style practice questions, detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics for Cisco, CompTIA, Microsoft, AWS, and other technology certifications.

© 2026 Courseiva. Courseiva is operated by JTNetSolutions Ltd. All rights reserved.

Courseiva is an independent certification practice platform and is not affiliated with, endorsed by, or sponsored by Cisco, Microsoft, AWS, CompTIA, Google, ISC2, ISACA, or any other certification vendor. Vendor names and certification marks are used only to identify the exams learners are preparing for.

HomeCertifications1Z0-829TopicsHandling Date, Time, Text, Numeric and Boolean Values
Free · No Signup RequiredOracle · 1Z0-829

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

19+ practice questions focused on Handling Date, Time, Text, Numeric and Boolean Values — one of the most tested topics on the Oracle Certified Professional Java SE 17 Developer 1Z0-829 exam. Each question includes a detailed explanation so you learn why the right answer is correct.

Start Handling Date, Time, Text, Numeric and Boolean Values Practice

Exam Domains

Handling Date, Time, Text, Numeric and Boolean ValuesControlling Program FlowUtilizing Java Object-Oriented ApproachHandling ExceptionsWorking with Arrays and CollectionsWorking with Streams and Lambda ExpressionsJava Platform Overview and PackagingAll domains →

Study Tools

Practice TestMock ExamFlashcardsAll Topics

Sample Handling Date, Time, Text, Numeric and Boolean Values Questions

Practice all 19+ →
1.

A developer is writing a method that takes a LocalDate and a ZoneId and returns the current time in that time zone as an OffsetDateTime. Which approach correctly implements this?

A.OffsetDateTime.of(LocalDateTime.now(), ZoneOffset.from(ZonedDateTime.now(zone)))
B.ZonedDateTime.now(zone).toOffsetDateTime()
C.LocalDate.now(zone).atStartOfDay(zone).toOffsetDateTime()
D.LocalDateTime.now().atZone(zone).toOffsetDateTime()

Explanation: Option B is correct because `ZonedDateTime.now(zone).toOffsetDateTime()` directly obtains the current date-time in the specified time zone and then converts it to an `OffsetDateTime` by extracting the zone offset. This approach correctly uses the provided `ZoneId` and returns the current time as an `OffsetDateTime` without any loss of precision or incorrect time manipulation.

2.

Which of the following correctly formats a NumberFormat instance to display a currency value for the US locale with exactly two decimal places, rounding half-up?

A.NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.US); nf.setRoundingMode(RoundingMode.HALF_UP);
B.NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.US); nf.setMinimumFractionDigits(2);
C.NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.US); nf.setMaximumFractionDigits(2);
D.NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.US);

Explanation: Option D is correct because `NumberFormat.getCurrencyInstance(Locale.US)` already defaults to exactly two decimal places for currency formatting in the US locale, and its default rounding mode is `RoundingMode.HALF_EVEN`. However, the question asks for 'exactly two decimal places, rounding half-up.' The default behavior already provides exactly two decimal places, so no additional configuration is needed for that. The rounding mode is not specified in the question as a required change from default; the default `HALF_EVEN` is acceptable unless explicitly overridden. Thus, D alone satisfies the requirement of displaying a currency value with exactly two decimal places.

3.

A developer needs to parse the string "2023-12-31T23:59:60Z" (a leap second) into a java.time.Instant. Which statement is true?

A.It returns an Instant representing 2023-12-31T23:59:59Z, ignoring the leap second.
B.It returns an Instant representing 2023-12-31T23:59:59Z with an added nanosecond.
C.It throws a DateTimeParseException because 60 seconds is invalid.
D.It returns null because the string is invalid.

Explanation: Option B is correct because java.time.Instant.parse() handles leap seconds by converting them to the last valid second of the minute (23:59:59) and then adding a nanosecond to account for the extra second. This behavior is specified by the ISO-8601 standard and the Java Time API, which does not support a true 60th second but represents it as an Instant with a fractional second adjustment.

4.

A method receives a Boolean reference and must set it to false if null. Which code accomplishes this correctly?

A.if (flag = null) flag = Boolean.FALSE;
B.flag = Boolean.FALSE.equals(flag) ? Boolean.FALSE : flag;
C.if (flag == null) flag = false;
D.if (flag.equals(Boolean.FALSE)) flag = null;

Explanation: Option B is correct because it uses Boolean.FALSE.equals(flag) which safely handles a null flag reference without throwing a NullPointerException. If flag is null, equals returns false, so the ternary assigns Boolean.FALSE; if flag is already Boolean.FALSE, it stays unchanged; otherwise, it keeps the original value. This matches the requirement to set the Boolean reference to false only when it is null.

5.

Which of the following correctly uses DateTimeFormatter to parse the date "2023-01-15" into a LocalDate?

A.LocalDate.parse("2023-01-15", DateTimeFormatter.ofPattern("yyyy-MM-dd"))
B.LocalDate.parse("2023-01-15", DateTimeFormatter.ofPattern("yyyy-mm-dd"))
C.MonthDay.parse("2023-01-15")
D.LocalDate.parse("2023-01-15", DateTimeFormatter.ISO_LOCAL_DATE)

Explanation: Option A is correct because `LocalDate.parse()` uses the `DateTimeFormatter` with the pattern `"yyyy-MM-dd"` which matches the ISO 8601 date format of the input string "2023-01-15". The uppercase `MM` correctly represents the month, and the pattern exactly matches the input, allowing successful parsing into a `LocalDate`.

+14 more Handling Date, Time, Text, Numeric and Boolean Values questions available

Practice all Handling Date, Time, Text, Numeric and Boolean Values questions

How to master Handling Date, Time, Text, Numeric and Boolean Values for 1Z0-829

1. Baseline your knowledge

Start with 10 questions to gauge your current understanding of Handling Date, Time, Text, Numeric and Boolean Values. This tells you whether you need a concept refresher or just practice.

2. Review every explanation

For each question — right or wrong — read the full explanation. Understanding why an answer is correct is more valuable than knowing the answer itself.

3. Focus on exam traps

Handling Date, Time, Text, Numeric and Boolean Values questions on the 1Z0-829 frequently use trap wording. Look for subtle differences in answers that test your precision, not just general knowledge.

4. Reach 80% consistently

Do repeated sessions until you score 80%+ three times in a row. Then move to mixed-mode practice to test cross-topic recall under realistic conditions.

Frequently asked questions

How many 1Z0-829 Handling Date, Time, Text, Numeric and Boolean Values questions are on the real exam?

The exact number varies per candidate. Handling Date, Time, Text, Numeric and Boolean Values is tested as part of the Oracle Certified Professional Java SE 17 Developer 1Z0-829 blueprint. Practicing with targeted Handling Date, Time, Text, Numeric and Boolean Values questions ensures you can handle any format or difficulty that appears.

Are these 1Z0-829 Handling Date, Time, Text, Numeric and Boolean Values practice questions free?

Yes. Courseiva provides free 1Z0-829 practice questions across all exam topics and domains. The platform includes topic-based practice, mock exams, missed-question review, bookmarked questions, and readiness tracking — no account required.

Is Handling Date, Time, Text, Numeric and Boolean Values one of the harder 1Z0-829 topics?

Difficulty is subjective, but Handling Date, Time, Text, Numeric and Boolean Values is a high-priority exam concept tested in multiple ways — direct recall, scenario analysis, and command-output interpretation. Consistent practice is the best way to build confidence.

Ready to practice?

Launch a full Handling Date, Time, Text, Numeric and Boolean Values practice session with instant scoring and detailed explanations.

Start Handling Date, Time, Text, Numeric and Boolean Values Practice →

Topic Info

Topic

Handling Date, Time, Text, Numeric and Boolean Values

Exam

1Z0-829

Questions available

19+