// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class Call {
   private static void test1(int v) {
      v++;
   }
   private static void test2(MyInt v) {
      v.setV(v.getV()+1);
   }
   private static void test3(int[] v) {
      v[0]++;
   }
   public static void main(String[] args) {
      int v1 = 0;
      test1(v1);
      System.out.println(v1);
      MyInt v2 = new MyInt();
      v2.setV(0);
      test2(v2);
      System.out.println(v2.getV());
      int[] v3 = new int[1];
      v3[0] = 0;
      test3(v3);
      System.out.println(v3[0]);
   }
}

class MyInt {
   private int v;
   public int getV() {
      return v;
   }
   public void setV(int i) {
      v = i;
   }
}
