01: /*
02: * MethodFailure5.java --
03: *
04: * tcljava/tests/signature/MethodFailure5.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: MethodFailure5.java,v 1.1 1999/05/10 04:09:08 dejong Exp $
12: *
13: */
14:
15: package tests.signature;
16:
17: import java.util.*;
18:
19: public class MethodFailure5 {
20:
21: public static String call(Dictionary a, Hashtable b) {
22: return "D+H";
23: }
24:
25: public static String call(Hashtable b, Dictionary a) {
26: return "H+D";
27: }
28:
29: public static Hashtable getH() {
30: return new Hashtable();
31: }
32:
33: public static Dictionary getD() {
34: return new Hashtable();
35: }
36:
37: /*
38:
39: //the purpose of this class is to test out method invocations
40: //that are defined as ambiguous byt the JLS. We should not
41: //be able to call these methods by passing in two derived
42: //types as arguments ie call(Hashtable,Hashtable).
43:
44: public static void main(String[] args) {
45: Hashtable b = new Hashtable();
46: call(b,b); //can not compile this ambiguous method reference
47: }
48:
49: */
50:
51: }
|