01: /*
02: * Compare.java --
03: *
04: * tcljava/tests/Compare.java
05: *
06: * Copyright (c) 1998 by Moses DeJong.
07: *
08: * See the file "license.terms" for information on usage and redistribution
09: * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
10: *
11: * RCS: @(#) $Id: Compare.java,v 1.1 1999/05/10 04:09:01 dejong Exp $
12: *
13: */
14:
15: package tests;
16:
17: import java.util.*;
18:
19: public class Compare {
20: private Hashtable thing = new Hashtable();
21:
22: public Compare() {
23: }
24:
25: public void empty() {
26: thing = null;
27: }
28:
29: public Object get1() {
30: return thing;
31: }
32:
33: public Dictionary get2() {
34: return thing;
35: }
36:
37: public Hashtable get3() {
38: return thing;
39: }
40:
41: public boolean compare(Object o1, Object o2) {
42: return (o1 == o2);
43: }
44:
45: public static void main(String[] argv) {
46: Compare c = new Compare();
47: Object r1 = c.get1();
48: Dictionary r2 = c.get2();
49: Hashtable r3 = c.get3();
50:
51: System.out.println("(r1 == r2) is " + (r1 == r2));
52: System.out.println("(r2 == r3) is " + (r2 == r3));
53: }
54:
55: }
|