CSE 1010 Lecture 18: Intro to object oriented programming (OOP) part 2, Object Oriented Programming, class, instance, method, instance variable, defining a class, __init__, constructor, self parameter, adding a method, calling a method

52 views4 pages
Verified Note

Document Summary

Intro to oop part 2 (part one: https://oneclass. com/class-notes/us/uconn/cse/ cse-1010/2216484-cse-1010-lecture-17. en. html) Does not display anything, modi es the balance directly: all of the accounts are public information. If you know the name of the variable where the account is stored, then you have the account"s personal information. If we added a password to the account, that would be accessible too. Class: template or blueprint that contains attributes that each instance must have. Instance: individual object that belongs to a class. Method: a function de ned in a class de ning the behavior of each instance in that class. Instance variable (member variable: a variable that is private to each instance. Simplest class: m is an instance of the myclass class. _ _init_ : special method; python reads it as the constructor for the class. !2: python calls the _ _init_ _ method automatically after it creates an instance of.

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