The class DeviceCounter is already defined with a private variable count, a constructor, and a getter.
Your task is to define the prefix ++ operator so that calling ++counter increments the count.
In main(): we are doing the following:
main()
n
DeviceCounter
0
++
Printing the final count in the format: Final count=<value>
count
Final count=<value>
Example Input:
3
Output:
Final count=3
Input:
5
Final count=5
Test Cases
Test Results
Input
Expected Output