CSC148H1 Lecture Notes - Lecture 2: Abstract Data Type
katrinasavvy and 38715 others unlocked
1
CSC148H1 Full Course Notes
Verified Note
1 document
Document Summary
The example above shows that everything is an instance of an object from a class. A class is an abstract data structure that models a real-world concept. They contain information about the attributes and abilities(methods) needed for that concept. Examples: int, str, list, or something user de ned, like a human, animal, pointer, etc. An object is an instance of a class. An object is composed of 3 components: id: reference to its memory location, data type: de nes what it can do, value: actual data contained within the object. There are two types of data types: mutable or immutable. Once immutable objects are stored in memory, they cannot change, like integers or booleans. Mutable objects are the opposite and are prone to change even after they are instantiated, like lists or dictionaries. False # because a and b are stored in different memory addresses.