001package subclass.ex9;
002
003public class M {
004        public static void main(String[] argv) {
005                O o = new X();
006                I i = o.getI();
007                i.m();
008        }
009}
010interface I { public void m(); }
011class O {
012        void p() {System.out.println("O.p");}
013        I getI() {
014                //return () -> O.this.p();
015                return new I() {
016                        public void m() {
017                                O.this.p(); // static or dynamic binding?
018                        }};
019        }
020}
021class X extends O {
022        void p() {System.out.println("X.p");}
023}