Chapter5_1-ClassesAndObjectsInDepth

Gannouni dr a touir introduction to oop accessibility

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: y from The Client class. :Y(client) public private - Accessible - Inaccessible Only public members Are visible from outside. All else is hidden from Outside. Page 12 Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP Accessibility from an Instance of the same Class one:X Accessibility from The Client class. two:X public private - Accessible - Inaccessible If a member is accessible from an instance, it is also accessible from other instances of the same class. Page 13 Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP UML Representation of a Class (UML Class Diagram) • UML uses three symbols to represent the visibility of the class’ members. • + : mentions that the member is public. • - : mentions that the member is private. • # : introduced in the CSC 113. ClassName - att1: dataType1 -… - atti: dataTypei + m1(…): dataType1 + ... + mj(…): dataTypej Page 14 Dr. S. GANNOUNI & Dr. A. TOUIR Attributes Methods (Services) Introduction to OOP Declaring Private Attributes <modifiers> <data type> <attribute name> ; Modifiers Modifiers private Page 15 Data Type Data Type String Name Name studentName ; Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP Example of a Class with...
View Full Document

Ask a homework question - tutors are online