lecture-9 - 14 Object Oriented Programming C++ Classes R.B....

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 14 Object Oriented Programming C++ Classes R.B. Lenin Winter 2006 DA-IICT Composition: Objects as Members of Classes • Composition • Class has objects of other classes as members • Construction of objects • Member objects constructed in order declared • Not in order of constructor’s member initializer list • Constructed before their enclosing class objects (host objects) • Constructors called inside out • Destructors called outside in 15 Object Oriented Programming C++ Classes R.B. Lenin Winter 2006 DA-IICT Composition: Objects as Members of Classes (II) • E x a m p l e : Employee::Employee( char *fname, char *lname, int bmonth, int bday, int byear, int hmonth, int hday, int hyear ) : birthDate( bmonth, bday, byear ), hireDate( hmonth, hday, hyear ) – Insert objects from Date class ( birthDate and hireDate ) into Employee class – birthDate and hireDate have member initializers - they are probably const s in the Employee class 16 Object Oriented Programming C++ Classes R.B. Lenin Winter 2006 DA-IICT...
View Full Document

This note was uploaded on 09/15/2010 for the course CSE IT325 taught by Professor Maniklaldas during the Spring '09 term at Punjab Engineering College.

Page1 / 16

lecture-9 - 14 Object Oriented Programming C++ Classes R.B....

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online