brown.cheryl1
brown.cheryl1 3d ago • 0 views

Multiple Choice Questions on Method Overriding and Overloading in Java

Hey everyone! 👋 Struggling a bit with method overriding and overloading in Java? It can be tricky to keep them straight, right? I've put together a quick study guide and some practice questions to help us nail these core OOP concepts. Let's conquer them together! 💻
💻 Computer Science & Technology
🪄

🚀 Can't Find Your Exact Topic?

Let our AI Worksheet Generator create custom study notes, online quizzes, and printable PDFs in seconds. 100% Free!

✨ Generate Custom Content

1 Answers

✅ Best Answer
User Avatar
philip877 Mar 16, 2026

📚 Quick Study Guide: Method Overloading & Overriding in Java

  • 🔄 Method Overloading: Occurs when multiple methods in the same class share the same name but have different parameter lists (number, type, or order of arguments).
  • ⚙️ It's an example of Compile-time Polymorphism (also known as static polymorphism). The compiler decides which method to call based on the arguments provided.
  • 📝 The return type can be different, but it's not sufficient alone to distinguish overloaded methods; the parameter list must differ.
  • ⬆️⬇️ Method Overriding: Occurs when a child class provides a specific implementation for a method that is already defined in its parent class.
  • 🏃 It's an example of Run-time Polymorphism (also known as dynamic polymorphism). The JVM determines which method to call at runtime based on the actual object type.
  • 🤝 The overridden method in the child class must have the same method signature (name, parameter list) and a compatible return type (covariant return types are allowed from Java 5 onwards).
  • 🔒 The access modifier of the overriding method cannot be more restrictive than the overridden method (e.g., if parent is public, child cannot be private).
  • 🚫 final methods cannot be overridden, as they are meant to be constant and immutable.
  • 👻 static methods cannot be overridden; instead, they are "hidden" by a child class's static method with the same signature.
  • 🔑 The super keyword can be used within the child class to call the overridden method of the parent class.

❓ Practice Quiz: Test Your Java Method Skills

  1. Which of the following is true about method overloading in Java?
    A) Methods must have different return types.
    B) Methods must have different access modifiers.
    C) Methods must have the same name but different parameter lists.
    D) Methods must be in different classes.
  2. What type of polymorphism is achieved through method overloading?
    A) Run-time polymorphism
    B) Compile-time polymorphism
    C) Dynamic polymorphism
    D) Virtual polymorphism
  3. Which keyword is used to explicitly call a parent class's method that has been overridden in the child class?
    A) this
    B) parent
    C) super
    D) base
  4. Can a final method be overridden in Java?
    A) Yes, always.
    B) Yes, if the access modifier is changed.
    C) No, final methods cannot be overridden.
    D) Only if the child class is in the same package.
  5. Consider the following code snippet:
    class A {
        void show() { System.out.println("A"); }
    }
    class B extends A {
        void show() { System.out.println("B"); }
    }
    // In main method:
    A obj = new B();
    obj.show();
    What will be the output?
    A) A
    B) B
    C) Compilation Error
    D) Runtime Error
  6. Which of the following statements about method overriding is INCORRECT?
    A) The overridden method must have the same return type (or a covariant return type in Java 5+).
    B) The access modifier of the overriding method can be more restrictive than the overridden method.
    C) It occurs between a parent class and its child class.
    D) It is an example of run-time polymorphism.
  7. If a class has multiple methods with the same name but different argument lists, it is an example of:
    A) Method Overriding
    B) Method Hiding
    C) Method Overloading
    D) Method Shadowing
Click to see Answers

1. C
2. B
3. C
4. C
5. B
6. B
7. C

Join the discussion

Please log in to post your answer.

Log In

Earn 2 Points for answering. If your answer is selected as the best, you'll get +20 Points! 🚀