I&C SCI 32 Lecture Notes - Lecture 1: Init

71 views1 pages

Document Summary

A class is blueprint for a new kind of object. Specifies what objects of the class can do, by defining a set of methods, each representing one operation these objects are capable of performing class thing: pass. Methods needs an extra" parameter, usually called self, which represents the object that the method is called on. X will refer to an object from our thing class. It"s also possible to require a constructor to take parameters, and we can write code that is executed when an object is initialized and uses those parameters during the initialization. All objects have a collection of attributes, which are the information that they"re storing at any given time. Assigning a value to an attribute is as simple as any other assignment state. We usually assign values into attributes only within the class, initializing them when the object is constructed. Localize the inner working of the class in the class itself.

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

Related Questions