001package basics.valref; 002public class Main { 003 private Main() {} 004 static public void main (String[] args) { 005 //stdlib.Trace.graphvizShowSteps (true); stdlib.Trace.run (); 006 int vi = 27; MutInt ri = new MutInt(42); 007 int vj = vi; MutInt rj = ri; 008 vi += 1; ri.plus(1); 009 System.out.println(vi); 010 System.out.println(vj); 011 System.out.println(ri); 012 System.out.println(rj); 013 } 014} 015final class MutInt { 016 private int v; 017 public MutInt(int v) { this.v = v; } 018 public String toString() { return "MutInt(" + v + ")"; } 019 public void plus(int z) { v += z; } 020}