Explicit vs implicit call of toString
问题 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 instance: System.out.println(\"obj: \"+obj); instead of: System.out.println(\"obj: \"+obj.toString()); Is there any difference apart from the null case? Can the latter case work, when the former does not? Edit: What exactly is done, in case of the implicit call? 回答1: There's little difference. Use the one that's shorter and works