001package basics.inner.five;
002public class Main {
003        private Main() {}
004        static public void main (final String[] args) {
005                C mc1 = new C(42);
006                C mc2 = new C(36);
007                mc1.f();
008                mc2.f();
009        }
010}
011
012interface Print { void print(); }
013
014class C {
015        int cx;
016        C(int x) { cx = x; }
017        void f() {
018                Print p = () -> System.out.println(" cx=" + cx);
019                p.print();
020                
021                G g = (int x) -> {
022                        cx = cx + x;
023                        cx = cx + x;
024                        cx = cx + x;
025                };
026                g.run(3);
027        }
028}
029
030interface G { void run(int x); }