AP CSA Unit 3 Day 19: Method Overriding vs. Overloading

Unit 3, Classes & Objects • Cycle 2
Day 19 Advanced Practice • Harder Difficulty
Focus: Method Overriding vs Overloading Hard Method Overriding vs Overloading

Advanced Practice Question

Format: Method Overriding vs Overloading

Which methods are in class Child?
public class Parent {
    public void work(int x) {
        System.out.println(x);
    }
}

public class Child extends Parent {
    public void work(int x) {
        System.out.println(x * 2);
    }
    
    public void work(double x) {
        System.out.println(x);
    }
}
Difficulty: Hard  |  Topic: Method Overriding vs Overloading  |  Cycle: 2 (Advanced)
Why This Answer?

work(int) has the same signature as Parent's method so it overrides. work(double) has different parameters so it overloads.

Common Mistake
Watch Out!

Confusing overriding (inheritance + same signature) with overloading (same name, different parameters).

AP Exam Strategy

Override = replace parent's method. Overload = add another version with different parameters.

Master This Topic

This Cycle 2 HARD question tests method overriding vs overloading. Review Unit 3 concepts to build mastery of classes & objects.

  • Understanding method overriding vs overloading
  • Tracing code execution accurately
  • Avoiding common pitfalls
View Unit 3 Study Guide

Ready for More Challenges?

Cycle 2 questions prepare you for the hardest AP CSA exam questions.

Study Games Practice FRQs
Back to blog

Leave a comment

Please note, comments need to be approved before they are published.