A useful technique to aid debugging Java applications is to add a
toString() method onto a class so that useful information can be output to help describe the class. Typically, a
toString() implementation would output any ID that an object has together with the description of the object. NetBeans provides facilities to allow developers to easily add and customize
toString() methods within classes.
First we will need to create a new project, so please refer to the recipes in Chapter 1, Using NetBeans Projects, for creating Java projects. To help follow this recipe, when creating a project, enter
CreatingToString as the project name and ensure that a main class called