This question already has an answer here:
- Java logical operator short-circuiting 8 answers
Excuse me if this is a stupid question. I understand the statement but do not know how it exactly works for each variable. How come y values below stays the same?
public boolean function(){
int x = 1;
int y = 2;
if (x ==1|| ++y >= 2){
}
System.out.println(y);
}
Aucun commentaire:
Enregistrer un commentaire