public class MyClass {
private ArrayList<MyDouble> list = new ArrayList<MyDouble>();
public void foo() {
...
double m = list.get(i).value+k
list.get(i).value = m;
...
}
// innere Klasse
private static class MyDouble {
private double value;
private MyDouble(double val) {
value = val;
}
}
}