COMPSCI 61A Lecture Notes - Lecture 16: Multiple Inheritance, Object-Oriented Programming, Init

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

Document Summary

Classes are objects too, so they have attributes. Class attribute: attribute of the class of an instance. Assignment statements wiht dot expression on their left-hand side affect attributes for the object of that dot expression. If the obj is instance, assignment sets an instance attribute. If obj is class, assignment sets a class attribute. A common use: two similar classes differ in their degree of specialization. The specialized class may have the same attributes as the general class, along with some special-case behavior. A checkingaccount is a specialized type of account. Most behavior is hsared w/ the base class account. Bank account that charges for withdrawals. Instead its part of looking up attribute by name, If it names an attrubte in the class, return the attribute value. 1: oterhwise , look up the name in teh base calss, if there is one, otherwise, look up the name in the base clas, if htere is one.

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