BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VEVENT
URL:https://www.learndesk.us/class/6534923311644672/lesson/36a0649793f2d897ccdb5b5e0462eda7?ref=outlook-calendar
SUMMARY:Notes
DTSTART;TZID=America/Los_Angeles:20260502T190000
DTEND;TZID=America/Los_Angeles:20260502T200000
LOCATION:https://www.learndesk.us/class/6534923311644672/lesson/36a0649793f2d897ccdb5b5e0462eda7?ref=outlook-calendar
DESCRIPTION: Week 8 Notes
====================================================================
* Garbage Collection

var a: BankAccount? = new BankAccount("Joe")
a = nil

- Q. what happens to the memory location occupied by the BankAccount data?
- A. Since no references to that data, language automatically reclaims it as free space

var a: BankAccount? = new BankAccount("Joe")
let b = a
a = nil

- But in the above it cannot garbage collect, because variable b is still pointing to that data!

- Modern languages automatically garbage collect, so no need to worry!

* Generics

Ex.

let a = ["foo", "bar"]

a's type here is List[String]
a[0] 's type here is: String

let a = [true, false, false]

a's type here is List[Bool]
a[0] 's type here is: Bool

Q. If you were to define the List class yourself, how will you describe it, since the subscript type is unknown at that time, and may be anything?

class List[?] { ..

- That's were generics come in!

class List { ...

Element is a "Type Variable"...

https://www.learndesk.us/class/6534923311644672/lesson/36a0649793f2d897ccdb5b5e0462eda7?ref=outlook-calendar
STATUS:CONFIRMED
SEQUENCE:3
BEGIN:VALARM
TRIGGER:-PT10M
DESCRIPTION:Class Reminder
ACTION:DISPLAY
END:VALARM
END:VEVENT
END:VCALENDAR