01: /*
02: * MethodFailure3.java --
03: *
04: * tcljava/tests/signature/MethodFailure3.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: MethodFailure3.java,v 1.2 2002/12/27 14:33:20 mdejong Exp $
12: *
13: */
14:
15: package tests.signature;
16:
17: import java.util.*;
18:
19: public class MethodFailure3 {
20:
21: public static String call(A obj) {
22: return "A";
23: }
24:
25: public static String call(I obj) {
26: return "I";
27: }
28:
29: // this method invocation is ambiguous
30: // call( getC() );
31:
32: public static interface I {
33: }
34:
35: public static class A {
36: }
37:
38: public static class B extends A {
39: }
40:
41: public static class C extends B implements I {
42: }
43:
44: public static A getA() {
45: return new A();
46: }
47:
48: public static B getB() {
49: return new B();
50: }
51:
52: public static C getC() {
53: return new C();
54: }
55:
56: public static I getI() {
57: return new C();
58: }
59:
60: }
|