Multiple choice

Which of the following variable types is/are not serializable in Java?

  1. Instance

  2. Static

  3. Transient

  4. Both 1 and 2

  5. Both 2 and 3

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

if a user does not want any field to be a part of object's state, then declare it either static or transient based on his need and it will not be included during Java serialization process.