I used to use the implicit call of toString when wanting some debug info about an object, because in case of the object is null it does not throw an Exception.
For i
As others have said - use the "" + obj method.
According to The Java Language Spec:
"null"new Boolean(X) or whatevertoString() is invoked (or equivalent)toString() is null, use "null"