008-002-009
Object Method: Counter
Easy
Problem Description
Object method: Counter
In this problem, you will create a program that instantiates a Counter class object, calls the increment() method a specified number of times to update its count value, and displays the result to standard output.
Learning Objective: Understand methods that change state
Create Counter class object and call increment method multiple times to count. Change object state with methods.
Input
Line 1: Count times (integer)
Output
Count: [times]
```java
## Examples
### Example 1: Count 3 times
Input:
```java
3
```java
Output:
```java
Count: 3
```java
### Example 2: Count 5 times
Input:
```java
5
```java
Output:
```java
Count: 5
```java
### Example 3: 0 times (boundary)
Input:
```java
0
```java
Output:
```java
Count: 0
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up