CSC148H1 Lecture Notes - Lecture 2: Abstract Data Type

17 views2 pages
1 Feb 2018
School
Course
Professor
katrinasavvy and 38715 others unlocked
CSC148H1 Full Course Notes
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.

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