Pregunta de entrevista de Blip (Portugal)

How to make a class immutable

Respuesta de la entrevista

Anónimo

7 nov 2024

The class must be final to prevent inherantance, every attribute must by final to prevent writing new values on them, remove any setter method that we have and ensure that every get in the class returns a deep copy insteaf of a shallow one