how can I pass a double value by reference in java?
example:
Double a = 3.0;
Double b = a;
System.out.println(\"a: \"+a+\" b: \"+b);
a = 5.0;
System.
@Title itself: You can't without "dirty" tricks. The easiest method is to pass an array - or a class containing the field. Changes to those will be reflected just fine.
But your problem is something completely different: Doubles are immutable, so every change to it will return a new value. There's nothing you can do about that, apart from implementing your own class.