Untitled

mail@pastecode.io avatar
unknown
java
7 months ago
238 B
4
Indexable
Never
public class CounterWithLimit{
    private int counter = 0;
    private int limit;

    public CounterWithLimit(int limit){
        this.limit = limit;
    }

    public void IncreaseBy1(){
        counter = (counter + 1) % limit;
    }
}
Leave a Comment