I have a for loop with multiple conditions like that:
for(int i = 4; i < 100 && (i-1)%6 == 0 || (i+1)%6 == 0; i++) {
//do something
}
Now, how does Java handle the conditions? Is it if both and conditions are correct or the other one or is my for loop doing something when the first and one of the last conditions are true? And should i use parenthesis to clarify what i want it to do?
I wanted to avoid to many if statements in my for loop, or am i obliged to use if statements?