EC Lecture Notes - Lecture 3: Class Variable, Instance Variable, Init

7 views4 pages

Document Summary

A class is a user-defined blueprint or prototype from which objects are created. Each class instance can have attributes attached to it for maintaining its state. Class instances can also have methods (defined by their class) for modifying their state. Class creates a user-defined data structure, which holds its own data members and member functions, which can be accessed and used by creating an instance of that class. A class is like a blueprint for an object. Attributes are the variables that belong to a class. Attributes are always public and can be accessed using the dot (. ) operator. State: it is represented by the attributes of an object. It also reflects the properties of an object. Behavior: it is represented by the methods of an object. It also reflects the response of an object to other objects. Identity: it gives a unique name to an object and enables one object to interact with other objects.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents