CSE 1010 Lecture Notes - Lecture 13: Class Variable, Instance Variable, Local Variable
jadetortoise401 and 55 others unlocked
84
CSE 1010 Full Course Notes
Verified Note
84 documents
Document Summary
Class - a user-defined prototype for an object that defines a set of attributes that characterize any object of the class. Instance - an individual object of a certain class. Method - a function defined in a class definition. Instantiation - the creation of an instance of a class. Class variable - a variable that is shared by all instance of a class. Class variables are defined within a class but outside any of the class"s method. Instance variable - a variable that is defined inside a method and belongs only to the current instance of a class. A class consists of the header and the body. Class instantiation - creates a new instance of the class and assigns this object to the local variable x x = myclass() An example of a class modeling a bank account class account: The header usually consists of just one line of code. The keyword class is used to define a class.