added observer sample

This commit is contained in:
Ilkka Seppala
2014-08-22 21:57:54 +03:00
parent 6246ed6d26
commit b3d48cc4df
8 changed files with 163 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
package com.iluwatar;
public class App
{
public static void main( String[] args )
{
Weather weather = new Weather();
weather.addObserver(new Orcs());
weather.addObserver(new Hobbits());
weather.timePasses();
weather.timePasses();
weather.timePasses();
weather.timePasses();
}
}