Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class A {
- public:
- A() {
- Method();
- }
- virtual void Method() {
- cout << "A" << endl;
- }
- };
- class B : public A {
- virtual void Method() {
- cout << "B" << endl;
- }
- };
- int main() {
- A a;
- B b;
- }
Advertisement
Add Comment
Please, Sign In to add comment