/Users/lyon/j4p/src/net/rmi/armi/AHelloWorldTest.java

1    package net.rmi.armi; 
2     
3    import java.util.*; 
4     
5    public class AHelloWorldTest 
6            implements Observer { 
7     
8        public AHelloWorldTest() { 
9        } 
10       public void update(Observable obs, 
11                          Object arg){ 
12           if(obs instanceof AHelloWorld) 
13               System.out.println(arg); 
14       } 
15       public static void main(String args[]){ 
16           AHelloWorld ashw 
17                   = new AHelloWorld(); 
18           AHelloWorldTest ashwt 
19                   = new AHelloWorldTest(); 
20           ashw.addObserver(ashwt); 
21           ashw.getMsg(); 
22           ashw.testGetMsg(); 
23       } 
24   } 
25