JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • Controlling the serialization process: writeObject, readObject

    JAVA 25 SELF
    43 level,0 lecture
    How to intercept default serialization and take control of the process: use private writeObject/ readObject methods with strict signatures ( private void writeObject( ObjectOutputStream out) throws IOException), call defaultWriteObject()/ defaultReadObject(), exclude fields via transient, add checksums and logs, and don’t forget about serialVersionUID and version compatibility. We cover common mistakes, working with ObjectOutputStream/ ObjectInputStream, and practical examples.
    Open
  • transient fields, serialVersionUID

    JAVA 25 SELF
    43 level,1 lecture
    A practical guide to serialization in Java: when and how to use transient to exclude fields from the stream, what happens during deserialization (default values), how to restore state in the readObject method; what serialVersionUID is, how to declare it ( private static final long serialVersionUID = 1L), when to change it, and why it’s better to set it explicitly. Working examples, risky scenarios, and common mistakes are shown.
    Open
  • Externalizable: fine-tuning serialization

    JAVA 25 SELF
    43 level,2 lecture
    Extending basic serialization in Java: when the automation of Serializable is not enough, the manual contract Externalizable with methods writeExternal/ readExternal comes to the rescue. In this lecture, we examine how to fully control the data format, reduce file size, and maintain backward compatibility; we compare it with the streams ObjectOutputStream/ ObjectInputStream, and show examples, pros/cons, and common pitfalls (the required public no-arg constructor, write/read order, etc.).
    Open
  • Configuring serialization behavior: custom methods

    JAVA 25 SELF
    43 level,3 lecture
    In this lecture, we examine how to influence the serialization and deserialization process in Java using the methods writeReplace and readResolve: why replace an object with a proxy, how to preserve a singleton, what to do with immutable objects, and how this relates to writeObject/ readObject. Step-by-step practice, a Mermaid flowchart of the operation flow, and a breakdown of common mistakes.
    Open
  • Serialization security: best practices

    JAVA 25 SELF
    43 level,4 lecture
    A practical guide to safe serialization in Java: why deserialization from untrusted sources is dangerous, how to defend using ObjectInputFilter, the transient keyword, an explicit serialVersionUID, type checks via instanceof, and alternative exchange formats (JSON/Proto). Inside — clear code examples, allowlist-based class filtering, and a breakdown of common mistakes.
    Open
Courses
  • Java Course
  • Python Course
  • Development with Claude Code
  • All 16 courses
University
  • Java FullStack
  • Python FullStack
  • AI Native Developer
  • Web FullStack
Community
  • Articles
  • Forum
  • Help with Tasks
Company
  • About us
  • Contacts
  • Reviews
  • Pricing
  • Questions and answers
JavaRush JavaRush: online courses in Java and other programming languages, where you learn by solving tasks. We started in 2012 with a Java course, and today there are 16 courses: Java and Spring, Python, web development, SQL, Go, C#, C++, Kotlin, Swift, Docker and AI development. More than 10,000 tasks with instant checks, and the first level of any course is free. Learn on your own or with a mentor at JavaRush University.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush Terms of Use and Privacy policy
MastercardVisa
"Programmers are not born" © 2026 JavaRush Terms of Use and Privacy policy