I came across two ways of getting BigDecimal object out of a double d.
1. new BigDecimal(d) 2. BigDecimal.valueOf(d)
Which would be a bette
Basically valueOf(double val) just does this:
return new BigDecimal(Double.toString(val));
Therefore -> yep, a new object will be created :).
In general I think it depends upon your coding style. I would not mixure valueOf and "new", if both are the same outcome.