Chapter3_2-ObjectsAndInstanceAtributes

Studentname coursecode mohammed csc 112 when we talk

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: rent data values assigned to these attributes. studentName courseCode Mohammed CSC 112 • When we talk about the current state of the object, we are really talking about the current values of its attributes. • • The values of instance attributes can change over time. A complete set of the specific values of these attributes forms a specific state of the object. Page 4 Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP State vs. Attribute • An instance attribute is an element of the object state. • The state of an object is defined by the set of values held by all its attributes. • Class attributes do not belong to the object state. • The characteristics (set of attributes) of an object almost never change during the object’s life. • The data values of the instance attributes change. The attribute set is (usually) a static concept. While state is (usually) a dynamic concept. Page 5 Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP Object Creation • Step 1 : First declare a variable of the given class. This variable is called instance variable or object reference variable. ClassName...
View Full Document

This document was uploaded on 03/03/2014.

Ask a homework question - tutors are online