Lecture 17: Object-Oriented Programming in C++

This lecture, the last of the module, concludes our look at C++. It begins with exploration of some features of C++ that aren’t found in Java: default arguments, operator overloading, and friendship. These features are illustrated using the Money example introduced in the previous lecture.

The second half of the lecture focuses on how inheritance and polymorphism work in C++, noting that the latter needs to be enabled explicitly by defining ‘virtual’ methods, and by manipulating objects via pointers. These concepts are illustrated using a C++ version of the shapes example discussed in Lecture 11.