Safely toString a Java object
Overview In this little article, we will see how to get the string representation(tostring) of an object cautiously, that means avoiding NullPointerException. Context Getting the String representation of a Java object is something we often do for logging, debugging, or simply for overview purposes. For a null object, we will be directed to a NullPointerException, as […]