Key Concepts

Review core concepts you need to learn to master this subject

Serialization: Lesson
Lesson 1 of 1
  1. 1
    Often when creating Java applications and working with objects, we find the need to persist them. Specifically, we need to be able to store an object’s state (member fields) in files, in memory, or…
  2. 2
    Previously we learned that in order to serialize an object, we needed our class to implement the Serializable interface. We should notice that although we implemented the interface, we did not need…
  3. 3
    Now that we’ve learned about the Serializable interface and how to implement it, let’s take a look at how to serialize an object to a file. To do this we’ll need to use the helper classes, FileOutp…
  4. 4
    Knowing how to serialize our objects is great but it becomes more useful when we can turn serialized objects back into Java objects with deserialization. As the name suggests, deserialization does …
  5. 5
    Often when serializing objects, we need to handle static class fields or exclude non-static fields in the serialization. Recall that the JVM defines a default way of serializing objects; this defau…
  6. 6
    As we’ve been serializing objects we’ve not only had primitive type fields but also reference types. For example: public class Person implements Serializable { private String name; private int…
  7. 7
    As we’ve learned about serialization we’ve discussed how the JVM defines a default way to serialize objects when their classes implement the Serializable interface. Can we modify this default proce…
  8. 8
    Great job! You’ve learned a lot about serialization. In this lesson we’ve discussed how: - Java makes serialization easy using the Serializable interface. - The Serializable interface is a _marke…

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo