I am mainly developing in .NET C# and I love the Events in C#.
Im now doing som Android stuff and thus must deal with Java. When porting some code from C# to Java I ran into the problem of Events; Java does not have anything that corresponds to C# Events.
So, when reading up on how Java handles "events", the only thing I can conclude is that it doesnt. There is no such thing as "events" in Java. Instead they use normal Interfaces and classes that implement those interfaces.
In Java: First, you have to first create the Interface Then, all classes that want to listen to the "event" has to implement that interface. Then, the class that fires the "event" has to keep a list of all listeners (Array of some sort) Then, the class that fires the "event" has to have a method so that listeners can add themselves to the Array
And when the firing class decides to "fire the event", it has to iterate through the Array of the listeners, calling the methods.
That is just plain Interface-usage, not Events in my world.
Am I wrong?