Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Human {
- public:
- virtual void sleep()=0;
- virtual void work() {
- cout<<"I'm working.\n";
- }
- };
- class student:public Human{
- public:
- void sleep(){
- cout<<"I'm sleeping.\n";
- }
- void work(){
- cout<<"I don't like work.\n";
- }
- };
- int main()
- {
- student kent;
- kent.sleep();
- kent.work();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement