Your task is to define two classes:
Generic Device
showType()
Sensor Device
The program will:
showSensor()
Example
Output:
Generic Device Sensor Device
Why this output?
Because showType() is inherited as protected, it can be called from inside Sensor, but not from main().
Question Significance
Shows how protected inheritance hides base methods from outside while still allowing derived classes to use them.
Test Cases
Test Results
Input
Expected Output