考虑以下类:
public class Money {
private double amount;
public Money(double amount) {
super();
this.amount = amount;
}
public double getAmount() {
return amount;
}
public void setAmount(double amount) {
this.amount = amount;
}
public Money multiplyBy( int factor) {
this.amount *= factor;
return this;
}
}
我可以采取哪些预防措施来确保此类在多线程方面没有任何问题。有良好的表现。同时确保货币精度不会成为问题