01: /*
02: * MethodFailure1.java --
03: *
04: * tcljava/tests/signature/MethodFailure1.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: MethodFailure1.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 MethodFailure1 {
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( getB() );
31:
32: public static interface I {
33: }
34:
35: public static class A {
36: }
37:
38: public static class B extends A implements I {
39: }
40:
41: public static A getA() {
42: return new A();
43: }
44:
45: public static B getB() {
46: return new B();
47: }
48:
49: public static I getI() {
50: return new B();
51: }
52:
53: }
|