CMSC 202 Computer Science II, Spring 2007, Section 010x
Lecture 6: Objects & Classes
Thursday 02/15, 2007
Assigned Reading: 7.1, 7.2
Slides As Shown:
- Announcement: Section 0105 can "make up" lab.
- Answered questions about
- Recap constructors:
- Reviewed basic use: slides.
- Showed a quick-and-dirty program for tracing constructor calls:
- BTW, Mr. Ellington pointed out after class that invoking the alternate
constructor from the default constructor:
doesn't do what we thought. This creates a temporary object of type abc,
initializes its data member to 17 and throws away the temporary object.
It doesn't initialize the data member of the "current" object.
- const members & methods. See slides linked above.
- The built-in int type has problems with
initialization and with overflow. We began a discussion of the
design for a class called ReallyLongInt (dubbed by the
class). Discussion will be continued next class.
[Spring '07 CMSC202]
15 Feb 2007 15:38:14 EST