public class Counter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
count
The integer count
|
Constructor and Description |
---|
Counter() |
Modifier and Type | Method and Description |
---|---|
int |
decrement()
Decrement and return the new count
|
int |
decrement(int n)
Decrement by n and return the new count
|
int |
getValue()
Get the current count
|
int |
increment()
Increment and return the new count
|
int |
increment(int n)
Increment by n and return the new count
|
int |
setValue(int value)
Set the current count
|
public int increment()
public int increment(int n)
public int decrement()
public int decrement(int n)
public int getValue()
public int setValue(int value)