1Z0-829 Java I/O API and Securing Applications Practice Question
Which interface should be implemented to create a custom filter for deserialization in Java?
⚠ Common exam trap
Test-takers frequently confuse `ObjectInputFilter` with `Serializable` or stream-level filters like `FilterOutputStream`, missing that the question specifically asks for a filter on the deserialization process itself.
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
✓
ObjectInputFilter
The `ObjectInputFilter` interface (introduced in Java 9) allows you to define a custom filter that validates classes and data being deserialized from an `ObjectInputStream`. By implementing this interface, you can reject potentially malicious or unexpected classes during deserialization, which is a key security measure against deserialization attacks.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
ObjectInputFilter
Why this is correct
Defines the filter to accept or reject classes during deserialization.
- ✗
Serializable
Why it's wrong here
Only marks a class as serializable.
- ✗
ObjectOutput
Why it's wrong here
Interface for object serialization output.
- ✗
FilterOutputStream
Why it's wrong here
For filtering output streams, not deserialization.
Go deeper
Related to this question
About these practice questions
This 1Z0-829 question is part of Courseiva's 513-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.