diff --git a/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/Data.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/Data.java index 9d76c1fcd1..533f4e111d 100644 --- a/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/Data.java +++ b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/Data.java @@ -17,9 +17,10 @@ public class Data { } } transfer = true; - + + String returnPacket = packet; notifyAll(); - return packet; + return returnPacket; } public synchronized void send(String packet) {