Observer Pattern in java, a better way?
<p>The code below was taken from another SO post, I was wondering is there a better way of writing this code, because its kind of ugly to have a loop that notifies all the listener at the end of every implemented method. If this is silly forgive me, I am new to Java.         </p>

<p>Note: I will be implementing more than one method in the interface, I will have 5 methods implemented. </p>

<pre><code>            import java.util.*;

            interface HelloListener {
                public void someoneSaidHello();
            }


            class Initiater {
                List&lt;HelloListener&gt; listeners = new ArrayList&lt;HelloListener&gt;();

                public void addListener(HelloListener toAdd) {
                    listeners.add(toAdd);
                }

                public void sayHello() {
                    System.out.println("Hello!!");

                    // Notify everybody that may be interested.
                    for (HelloListener hl : listeners)
                        hl.someoneSaidHello();
                }
            }


            class Responder implements HelloListener {
                @Override
                public void someoneSaidHello() {
                    System.out.println("Hello there...");
                }
            }
</code></pre>
