Your task is to define a class named Sensor with:
Sensor
value (type int)
setValue(int v)
getValue()
The program will:
Example
Output:
Sensor value: 75
Why this output?
The private variable is set through the setter method and read through the getter.
Question Significance
Demonstrates encapsulation — private data with public access methods.
Test Cases
Test Results
Input
Expected Output