Answer the question
In order to leave comments, you need to log in
How to increase one variable depending on another?
I understand that the question is stupid and it is quite possible that I will understand how to do it with a fresh mind in the morning, but unfortunately I need it right now.
There are two variables:
int simbol_lenght = 0;
int count_simbol_up = 0;
simbol_lenght
during operation, it can take any value from 0 and above. count_simbol_up
How can I make it increase by +1 every time the value of this variable is greater than 2 ? Answer the question
In order to leave comments, you need to log in
class BindedInts {
int symbolLenght;
int countSymbolUp;
Integer getCountSymbolUp() {
return this.symbolLenght > 2 ? this.symbolLenght+1 : this.countSymbolUp;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question