Question: Write the definition of a class Counter containing: An instance variable counter of type int. A function called reset that set the instance variable
Write the definition of a class Counter containing: An instance variable counter of type int. A function called reset that set the instance variable counter to zero. It does not accept parameters or return a value. A function called increment that adds one to the instance variable counter. It does not accept parameters or return a value. A function called getValue that doesn't accept any parameters. It returns the value of the instance variable counter.
Step by Step Solution
3.39 Rating (152 Votes )
There are 3 Steps involved in it
Heres the definition of the Counter class with the requested functionalities ... View full answer
Get step-by-step solutions from verified subject matter experts
