Skip to content
Sharp

Core Java · interview question

Why do teams use parameters in a method in production code?

Multiple choiceMediumchapter-1-curatedpremiumcore-javamethods
Choose one answer
Answer and explanation

Correct answer

D. They allow the method to accept input values from outside.

Why

Parameters allow methods to accept input values, enabling the method to perform operations based on those inputs. This makes methods more flexible and reusable across different contexts.

Test yourself on Core Java

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

Start free test
All Core Java questions →