Skip to content
Sharp

Modern Java · interview question

Which implementation of the toString() method in a Java Record is the default in Java?

Multiple choiceMediumchapter-12-curatedpremiummodern-javajava-records
Choose one answer
Answer and explanation

Correct answer

A. It returns a string representation of the Record’s fields.

Why

The toString method in a Java Record provides a string representation of the Record’s fields, making it easier to visualize its data without additional implementation.

Test yourself on Modern Java

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

Start free test
All Modern Java questions →