SE450: Inner Class: Link Names [5/16] Previous pageContentsNext page

The outer class link has a funny name:

file:Main.java [source] [doc-public] [doc-private]
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package basics.inner.three;
public class Main {
  private Main() {}
  static public void main (final String[] args) {
    //stdlib.Trace.graphvizShowSteps (true); stdlib.Trace.run ();
    C mc1 = new C(42);
    C mc2 = new C(36);
    mc1.f();
    mc2.f();
  }
}

interface Print { void print(); }

class C {
  int cx;
  C(int x) { cx = x; }
  void f() {
    Print p = new Print() {
      int py = 27;
      public void print() {
        System.out.println(" cx=" + C.this.cx + " py=" + this.py);
      }
    };
    p.print();
  }
}

Previous pageContentsNext page