This preview shows page 1. Sign up to view the full content.
Unformatted text preview: rent data values assigned to these attributes. studentName
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
View Full Document
This document was uploaded on 03/03/2014.
- Spring '14