MCQ Single Best Answer Moderate

QWhich of the following pairs of methods will cause a compile-time error due to incorrect method overloading?

ID: #24163 ICSE Computer Application - Class X - 2025 PYQ 198 views
Question Info
#24163Q ID
ModerateDifficulty
ICSE Computer Application - Class X - 2025 PYQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A void test(int a, int b) and void test(double a, double b)
  • B void test(int a, double b) and void test(double a, int b)
  • C void test(int a, double b) and void test(int a)
  • D void test(int a) and int test(int a)
Correct Answer: Option D

Explanation

(d) void test(int a) and int test(int a)
Explanation: Method overloading is based on method signatures (method name + parameter list). Return type differences (void vs. int) do not differentiate overloaded methods, leading to a compilation error.

Share This Question

Challenge a friend or share with your study group.