added observer sample
This commit is contained in:
18
observer/src/main/java/com/iluwatar/App.java
Normal file
18
observer/src/main/java/com/iluwatar/App.java
Normal 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();
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user