Multiple choice technology web technology

What are transient variables in java?

  1. Transient variables are variable that cannot be serialized.

  2. Transient variables are variable that can be serialized.

  3. Transient variables has no special feature

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The transient keyword in Java marks fields that should be skipped during serialization. When an object is serialized, transient fields are not written to the output stream and will have default values when deserialized.