I tried to simulate pass-by-ref in java by passing an array of size 1 that contains the value to a corresponding method.
The source:
public static