diff --git a/core-java/src/main/java/com/baeldung/constructorsstaticfactorymethods/entities/User.java b/core-java/src/main/java/com/baeldung/constructorsstaticfactorymethods/entities/User.java index ec7bf6b5fa..4036b622c6 100644 --- a/core-java/src/main/java/com/baeldung/constructorsstaticfactorymethods/entities/User.java +++ b/core-java/src/main/java/com/baeldung/constructorsstaticfactorymethods/entities/User.java @@ -8,7 +8,7 @@ import java.util.logging.SimpleFormatter; public class User { - private static User instance = null; + private static volatile User instance = null; private static final Logger LOGGER = Logger.getLogger(User.class.getName()); private final String name; private final String email;