Dyn Link Example
class Stuff {
private int a, b;
private int fred(int b) {
a = a + b;
return 4;
}
private class Barney {
private int a;
private void sigfreid() {
a = fred(a);
}
public void barney(int c) {
a = c;
sigfreid();
System.out.println(a + " " + b + " " + c);
}
}
public Stuff() {
a = 2;
b = 7;
Barney barn = new Barney();
barn.barney(3);
System.out.println(a + " " + b);
}
}
class Callex {
public static void main(String[] argv) {
new Stuff();
}
}
Output is identical to the Pascal version:
4 7 3
5 7