#include <iostream>

using namespace std;

/* Base class*/

class Devvice {

public:
    void printType() {
        cout << "Generic Device" << endl;
    }
};

class Sensor : public Devvice {
public:
    void printSensor() {
        cout << "Sensor Device" << endl;
    }
};

int main(){
    Sensor sensor;
    
    sensor.printType();   // Inherited method from Devvice
    sensor.printSensor(); // Method from Sensor

    return 0;
}
Upvote
Downvote
Loading...

Input

Expected Output

Generic Device Sensor Device