cpp-2013 #6 oop part 2

7

Click here to load reader

Upload: eleks-developers-courses-if

Post on 26-May-2015

764 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: cpp-2013 #6 OOP Part 2

How OOP works in C++

Page 2: cpp-2013 #6 OOP Part 2

Inheritance• What it is and why it is needed• Protected members• Order of calling constructors/destructors• Types of inheritance– public– protected– private

• Methods overload

Page 3: cpp-2013 #6 OOP Part 2

Virtual methods• Pointers to base class can point to derived

object• Why it is needed. Method overriding• Calling basic class methods• Do not call virtual methods in

constructor/destructor• Virtual destructors

Page 4: cpp-2013 #6 OOP Part 2

Pure virtual methods• Pure virtual methods• Do NOT call virtual methods in

constructor/destructor • Do not call methods which call virtual

methods in constructor/destructor

Page 5: cpp-2013 #6 OOP Part 2

Interfaces• What is called interface• Why it is needed

Page 6: cpp-2013 #6 OOP Part 2

C++11 keywords• override• final

Page 7: cpp-2013 #6 OOP Part 2

Forward declaration• What is it• Why we need it