Vote count:
0
public class DecreasingCounter {
private int value; // instance variable that remembers the value of the counter
int valueInitial;
public DecreasingCounter(int valueAtStart) {
this.value = valueAtStart;
}
public void reset(){
this.value = 0;
}
public void setInitial(){
this.valueInitial = 0;
}
}
I need to change the value back to what it was in DecreasingCounter(x);
with setInitial();
Using a object variable, but I don't know how.
asked 11 secs ago
Setting counter value back to initial in class
Aucun commentaire:
Enregistrer un commentaire