1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>
class Base final {
public:
void display() {
std::cout << "Base class display function" << std::endl;
}
};
// This will cause a compile-time error
// class Derived : public Base {
// };
int main() {
Base b;
b.display();
return 0;
}
Back to final