r/javahelp • u/thechexmo • Jul 21 '20
Are there meaningful differences between Java observers, listeners and events?
I'm studying design patterns (self taught using "head first design patterns" book) and recently got into Observer patterns... The book says some things about Java out-of-the-box Observer/Observable, but it's not fully clear about what i am asking for... Maybe is a stupid question, but i want to dive deeper into this. Thanks.
20
Upvotes
1
u/wsppan Jul 21 '20
You are studying a design pattern. You can implement it by hand, https://www.geeksforgeeks.org/observer-pattern-set-1-introduction/
Or use the built ins that come with the JDK, https://javarevisited.blogspot.com/2011/12/observer-design-pattern-java-example.html?m=1