Saturday, December 12, 2015

Getters and Setters

   >>> The concept of getters and setters supports the concept of data hiding.

   >>> Because other objects should not directly manipulate data within another object, the getters and setters provide controlled access to an objects's data.

   >>> Getters and setters are sometimes called accessors methods or mutator methods.

>>>> The following information is all the user need to know to effectively use the methods:

    1. The name of the methods.
    2. The parameters passed to the method.
    3. The return type of the method.

No comments:

Post a Comment