Wednesday, October 27, 2010

Access Modifiers | Private, Public & Protected

An access modifier determines the visibility of a class member (states & behaviours).
An access modifier of Public allows a class member to be accessed from external objects & is denoted on a class diagram with a + (addition) symbol.
A Private access modifier allows only internal access and prevents access by external objects. Private access is denoted on a class diagram with the - (minus) symbol.
The Protected access modifier allows internal access and access by child classes. Protected access is denoted on a class diagram with the # (hash) symbol.

No comments:

Post a Comment