Courseiva
Java Basics and SyntaxeasyMultiple ChoiceObjective-mapped

1Z0-811 Java Basics and Syntax Practice Question

Which method overloading is valid?

⚠ Common exam trap

Oracle often tests the misconception that changing the return type or access modifier alone is sufficient for method overloading, but the key requirement is a different parameter list.

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

void print(int a) and void print(String s) {}

Method overloading in Java requires methods to have the same name but different parameter lists (different number, type, or order of parameters). Here, `void print(int a)` and `void print(String s)` have different parameter types (`int` vs `String`), which satisfies the overloading rule. The return type or access modifiers do not affect overloading.

Answer analysis

Option-by-option breakdown

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

  • void print(int a) and void print(int b) {}

    Why it's wrong here

    Same signature, not overloading.

  • void print(int a) and int print(int a) {}

    Why it's wrong here

    Same parameter list, different return type - not overloading.

  • void print(int a) and private void print(int a) {}

    Why it's wrong here

    Same signature; access modifier doesn't change signature.

  • void print(int a) and void print(String s) {}

    Why this is correct

    Different parameter types - valid overloading.

About these practice questions

This 1Z0-811 question is part of Courseiva's 481-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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This 1Z0-811 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-811 exam.