Java is pass-by-value. How could you modify the language to introduce passing by reference (or some equivalent behavior)?
Take for example something like
<
Using AtomicReference class as holder object.
public static void main(String[] args) {
String variable="old";
AtomicReference at=new AtomicReference(variable);
passByReference(at);
variable=at.get();
System.out.println(variable);
}
public static void passByReference(AtomicReference at) {
at.set("new");
}