summaryrefslogtreecommitdiffstats
path: root/tests/pureJava/QualifiedNewCP.java
blob: 728ffc86140123d126e94229123b720339478dbd (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
public class QualifiedNewCP {
    public static void main(String[] args) {
        Base b = new Base();
        I o = b.new Inner();
        o.m();
        o = b.new AbstractInner() { public void m() { System.out.println("mi"); helper(); } };
        o.m();
        o = b.new Inner() { public void m() { System.out.println("mi"); } };
        o.m();
    }
}

class Base {
    class Inner implements I {
        public void m() { System.out.println("m"); }
    }
    abstract class AbstractInner implements I {
        //public abstract void m();
        protected void helper() { System.out.println("helper"); }
    }

    protected void foo() {
        System.out.println("foo");
    }
}

interface I {
    public void m();
}