Convert Object to String in java
<p>What is the best way to convert an object I get from a database to String in Java? For example, I have a field which returns a BigDecimal. How do I convert it to String, while keeping it as null (primitive), if it comes back null? I was using String.valueOf(obj), but this actually transforms it to the String representation "null". </p>