summaryrefslogtreecommitdiffstats
path: root/tests/pureJava/InterfaceCast.java
blob: cd4a77ce9f2b1a074924ee1fd1fcaf90b61bf394 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class A {}
interface I {}
class B extends A implements I {}

public class InterfaceCast {

    public static void main(String[] args) {}

    void foo(A a, B b, I i) {
	A a0 = a;
	A a1 = b;
	A a2 = (A)i;

	B b0 = (B)a;
	B b1 = b;
	B b2 = (B)i;

	I i0 = (I)a;
	I i1 = b;
	I i2 = i;
    }
}