Skip to content
Sharp

Modern Java · interview question

Which of the following would prevent a record from being serialized?

Multiple choiceHardchapter-7-curatedpremiummodern-javarecords
Choose one answer
Answer and explanation

Correct answer

A. Including non-serializable components.

Why

If a record includes non-serializable components, it cannot be serialized. All components of a record must implement Serializable for the record itself to be serializable.

Test yourself on Modern Java

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

Start free test
All Modern Java questions →