Skip to content
Sharp

Object-oriented programming · interview question

How does Java distinguish between different methods with the same name in a class?

Multiple choiceMediumchapter-2-curatedpremiumoopclasses-and-objects
Choose one answer
Answer and explanation

Correct answer

A. By their parameter lists

Why

Java distinguishes between methods with the same name by their parameter lists, a concept known as method overloading. The method signature, which includes the method name and parameter types, must be unique.

Test yourself on Object-oriented programming

A free test with instant, explained results. No account needed.

Start free test
All Object-oriented programming questions →