summaryrefslogtreecommitdiff
path: root/libjava/testsuite/libjava.lang/anon_ctor_itf_arg.java
blob: 1fd16f12b8305e92927cab94e1e8dcb62f3aa7f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* From java/3285, By p.thio@valescom.com */

interface I
{
    void print ();
};

class C1
implements I
{
    public void print () { System.out.println ("C1: Message"); }
}

abstract
class C2
{
    C2(I i)
    {
	i.print ();
    }
    abstract void h();
}

public
class anon_ctor_itf_arg
{
    public static
    void main(String argv[])
    {
        C1 c1 = new C1();
        new C2(c1)
        {
            void h()
            {
            }
        };
    }
}