When you define a new type, best practices dictate that you should provide an override for the toString method. This method should return a string describing the instance. Let's consider the BlogEntry class we defined at the beginning of this chapter. You will have to do quite a bit of typing to implement this method, but why do it when you can get it out of the box? Let the compiler do it for you. If you add or remove a new field, it will automatically update the code for you. The likelihood of you leaving out the change to the toString code body when a field is added/renamed/removed is quite high:
public java.lang.String toString(); Code: 0: new #122 // class java/lang/StringBuilder 3: dup 4: invokespecial #123 // Method java/lang/StringBuilder."<init>":()V 7: ldc ...