COMPSCI 61A Lecture Notes - Lecture 15: Init, Object-Oriented Programming

42 views4 pages
zogo39484755 and 6 others unlocked
COMPSCI 61A Full Course Notes
22
COMPSCI 61A Full Course Notes
Verified Note
22 documents

Document Summary

Each object has its own local state. Each object also knows how to manage its own local state based on method calls. Method calls are messages passed between objects. Several objects can be instances of a common type. Different types may relate to each other. Specialized syntax and vocab to support behavior. A class serves as a template for its instances. All bank accounts have a balance and an account holder. Account class hsould add those attribtutes to each newly created instance. All bank acounts share a withdraw method" and a deposit" method. Nose and dance are attributes of class clown. _init_ method of the class is called with new objects with its first arguement, w/ any additional args provided in the call expression. Init is called the constructor: special b/c whenever class is called, gets called automatically. Every obj that is instance of user-defined class has unique identity. Operators is/ is not test if objects are the same.

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