Courseiva
Question 32 of 513

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

What is the result of executing the following code snippet?

BigDecimal d1 = new BigDecimal("1.00"); BigDecimal d2 = new BigDecimal("1.0"); System.out.println(d1.equals(d2));

⚠ Common exam trap

Watch out — candidates often assume `equals` behaves like `compareTo` or like primitive `==` for numeric values, forgetting that `BigDecimal.equals` enforces scale equality, so `1.00` and `1.0` are not equal.

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

false

The `equals` method of `BigDecimal` compares both the numeric value and the scale (number of digits after the decimal point). Since `new BigDecimal("1.00")` has a scale of 2 and `new BigDecimal("1.0")` has a scale of 1, they are not considered equal by `equals`, even though they represent the same mathematical value. Therefore, the output is `false`.

Answer analysis

Option-by-option breakdown

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

  • false

    Why this is correct

    Correct: d1.equals(d2) returns false due to scale mismatch.

  • compile error

    Why it's wrong here

    Incorrect: The code compiles and runs without error.

  • true

    Why it's wrong here

    Incorrect: equals() returns false because scales are different (2 vs 1).

  • 1

    Why it's wrong here

    Incorrect: The output is a boolean, not an integer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 25, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.