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