The data located within an object are referred to as variables or attributes. An object may have any number of such variables.While variables are normally hidden from the outside world and accessed or manipulated through visible functions or methods provided for those purposes, this is not always the case. In Java, variables may also be public and manipulated directly, as indicated in the figure, below, as opposed to being manipulable only through methods. The reader should note, however, that using public variables is not generally considered good O-O programming practice.
Variables/Attributes. Shows an object that includes both private and public variables, as well as public methods.