Skip to content
Sharp

Core Java · interview question

Which statement about method return values is true?

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

Correct answer

C. The return type must match the data type of the returned value.

Why

The return type of a method must match the data type of the value it returns, ensuring type safety and consistency in the program.

Test yourself on Core Java

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

Start free test
All Core Java questions →