Courseiva
Question 321 of 513
Utilizing Java Object-Oriented ApproacheasyMultiple ChoiceObjective-mapped

1Z0-829 Utilizing Java Object-Oriented Approach Practice Question

A class `Account` has a method `public void deposit(double amount)`. Which approach correctly demonstrates method overloading?

⚠ Common exam trap

Many candidates confuse method overloading with method overriding, or mistakenly believe that changing the return type or access modifier alone is sufficient for overloading, when in fact only the parameter list matters.

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

Adding a method `public void deposit(int amount)`

Method overloading requires methods to have the same name but different parameter lists. Changing the parameter type from `double` to `int` satisfies this requirement, allowing the compiler to distinguish the methods at compile time based on the argument type.

Answer analysis

Option-by-option breakdown

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

  • Adding a method `public void deposit(int amount)`

    Why this is correct

    Different parameter type overloads correctly.

  • Adding a method `public void deposit(double amount)` with different implementation

    Why it's wrong here

    Identical signature is not allowed; duplicate method.

  • Adding a method `public int deposit(double amount)`

    Why it's wrong here

    Only changing return type does not overload; it will cause a compile error.

  • Adding a method `protected void deposit(double amount)`

    Why it's wrong here

    Changing access modifier alone is not overloading.

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.