Chapter 5. Mutable and Immutable Classes
In this chapter, we will learn about mutable and immutable classes. We will understand their differences and their advantages and disadvantages when building object-oriented code. We will:
- Create mutable classes
- Work with mutable objects in JShell
- Build immutable classes
- Work with immutable objects in JShell
- Understand the difference between mutating and non-mutating objects
- Learn the advantages of non-mutating objects when writing concurrent code
- Work with instances of the immutable
String
class