Lecture 4 - Review Execu.on Order of Derived Class...

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

View Full Document Right Arrow Icon
10/12/12 1 Cs 3710 Voca.onal Languages October 12, 2012 Review: Execu.on Order of Derived Class Constructor 1± Alloca.ng space for the en.re object to store base class plus derived class’s members± 2± Calling the base class's constructor to ini.alize the base-class members± 3± Ini.alizing the derived class members using the constructor ini.aliza.on list ± 4± Execu.ng the body of the derived class constructor± Review: Constructors Opera.on //constructor AudioBook::AudioBook(string title_in, int year_in, double length_in): Book(title_in,year_in) ,length(length_in){} //Book::Book(string,int)-step 2 //assing lengt_in to length – step 3 //constructor AudioBook::AudioBook(string title_in, int year_in, double length_in):length(length_in){} //Book::Book()- step 2 (default) //assign length_in to length – step 3 //constructor AudioBook::AudioBook(string title_in, int year_in, double length_in):length(length_in){ Book::Book(title_in,year_in) } //Book::Book()-step 2 //assign length_in to length – step 3 //Book::Book(string, int) – step 4 AudioBook c("JavaScript",2008,2.5); Review: Sta.c Binding The type of implicit parameter determines which of the
Background image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 3

Lecture 4 - Review Execu.on Order of Derived Class...

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

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