Classes and Objects
- slide 23 : 29
Creating and Deleting Objects
Possible approaches to creation and deletion of objects
Creating Objects
By instantiating classes
Implicitly: via variable declarations
Explicitly: on demand, by command
By copying existing object -
cloning
Deleting Objects
Explicitly: on demand, by command
Implicitly: deleted when not used any longer - via use of
garbage collection
Modern object-oriented languages support explicit object creation and implicit object deletion (by means of garbage collection)