/Users/lyon/j4p/src/collections/getclass/Test.java

1    /* 
2     * Test.java 
3     * 
4     * Created on December 4, 2002 
5     */ 
6     
7    package collections.getclass; 
8     
9    /** 
10    * Demonstrates that using instanceof in a class's equals method 
11    * can cause problems. 
12    * @author  Thomas Rowland 
13    */ 
14   public class Test { 
15    
16       public static void main(String[] args) { 
17           Parent parent = new Parent(); 
18           Child child = new Child(); 
19    
20           System.out.println(parent.equals(child)); 
21           System.out.println(child.equals(parent)); 
22       } 
23    
24   } 
25