If data fields (attributes) are public, programmers can change them.
Generally want to hide the data from programmers that will use the class.
If programmers can access a class's fields directly, you have no control over what values they can assign.
In the Body example, nextIDshould be private.
If necessary, you should provide get methods that allow programmers to determine the current field value, and set methods to modify the value. These are called accessors (get) and mutators (set).