Courseiva
Question 175 of 513
Java I/O API and Securing ApplicationsmediumMultiple ChoiceObjective-mapped

1Z0-829 Java I/O API and Securing Applications Practice Question

A class implements Serializable. Which modification ensures that a specific field (password) is not included in the serialized stream?

⚠ Common exam trap

Many candidates confuse `transient` with `volatile` or `static`, mistakenly thinking that `volatile` affects serialization or that `static` is the proper way to exclude a field, when in fact `static` fields are excluded by default but are not appropriate for instance-specific data like a password.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Declare the field as transient

The `transient` modifier is the correct mechanism in Java to exclude a specific field from the default serialization process. When a class implements `Serializable`, all non-transient instance fields are serialized by default. Marking the `password` field as `transient` ensures it is skipped during serialization and restored as `null` (or default value) upon deserialization.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Declare the field as volatile

    Why it's wrong here

    volatile has no effect on serialization.

  • Declare the field as transient

    Why this is correct

    Transient fields are skipped during serialization.

  • Declare the field as static

    Why it's wrong here

    Static fields are not serialized, but this is a misuse if the field should be instance-specific.

  • Declare the field as final

    Why it's wrong here

    final does not exclude from serialization.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This 1Z0-829 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-829 exam.