intermediateCore Java Fundamentals11 of 436

Can we overload a method by changing only its return type?

Tests whether you know overload resolution is based solely on the method signature (name + parameter types), so return type alone causes a compile error -- not ambiguity, because the compiler can't distinguish the two methods at all.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

← Back to all Core Java questions