cpp-2013 #6 oop part 2
TRANSCRIPT
![Page 1: cpp-2013 #6 OOP Part 2](https://reader037.vdocuments.us/reader037/viewer/2022100517/55635912d8b42a2f508b4720/html5/thumbnails/1.jpg)
How OOP works in C++
![Page 2: cpp-2013 #6 OOP Part 2](https://reader037.vdocuments.us/reader037/viewer/2022100517/55635912d8b42a2f508b4720/html5/thumbnails/2.jpg)
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](https://reader037.vdocuments.us/reader037/viewer/2022100517/55635912d8b42a2f508b4720/html5/thumbnails/3.jpg)
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](https://reader037.vdocuments.us/reader037/viewer/2022100517/55635912d8b42a2f508b4720/html5/thumbnails/4.jpg)
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](https://reader037.vdocuments.us/reader037/viewer/2022100517/55635912d8b42a2f508b4720/html5/thumbnails/5.jpg)
Interfaces• What is called interface• Why it is needed
![Page 6: cpp-2013 #6 OOP Part 2](https://reader037.vdocuments.us/reader037/viewer/2022100517/55635912d8b42a2f508b4720/html5/thumbnails/6.jpg)
C++11 keywords• override• final
![Page 7: cpp-2013 #6 OOP Part 2](https://reader037.vdocuments.us/reader037/viewer/2022100517/55635912d8b42a2f508b4720/html5/thumbnails/7.jpg)
Forward declaration• What is it• Why we need it