Last active
March 29, 2019 11:36
-
-
Save kateolenya/312185689e5a0ff1d296ca9db2b7f41e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Device { | |
public: | |
Device() { | |
cout << "Device constructor called" << endl; | |
} | |
}; | |
class Computer: public Device { | |
public: | |
Computer() { | |
cout << "Computer constructor called" << endl; | |
} | |
}; | |
class Monitor: public Device { | |
public: | |
Monitor() { | |
cout << "Monitor constructor called" << endl; | |
} | |
}; | |
class Laptop: public Computer, public Monitor {}; | |
int main() { | |
Laptop Laptop_instance; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment