Skip to content
Sharp

I/O · interview question

Which statements about Java serialization are true? Select all that apply.

Select all that applyMedium
Select all that apply
Answer and explanation

Correct answer

  • A. A class must implement Serializable to be serialized with ObjectOutputStream.
  • B. transient fields aren't serialized.
  • D. Deserializing untrusted data is a security risk.

Why

Deserialization can instantiate arbitrary classes and trigger gadget chains. Prefer JSON or protobuf for external data, or use serialization filters.

References

Test yourself on I/O

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

Start free test