COIS 1020H Lecture 11: WEEK 11 LEC NOTES
Document Summary
Enables you to use arithmetic symbols with your own objects. ++ -- true false: when a binary operator is overloaded and has a corresponding assignment operator. Declaring an array of objects: you can declare array that hold elements of any type. Understanding destructors: destructor- contains the actions you rewuire when an instance of a class (object) is destroyed, most often , an instance of a class is destroyed when it goes out of scope (program terminates) You can create classes wthat are only programs with a main() method and classes from which you instantiate objects. When creating a class: must assign a name to it and determine what data and methods will be part of the class, usally declare instance variables to be private and instance methods to be public. When a creating an object: supply a type and an identifier, and you allocate computer memory for that object.