mercredi 12 juin 2019

What is the executing order of if((a=a++)>b--)?

int a = 8;
int b = 9;

if ((a = a++) > b--)
    System.out.println("Yes " + a + "," + b);
else
    System.out.println("No " + a + "," + b);

Here the answer is No 8, 8

How come here the value of a didn't get assign to the new value? Can someone explain to me the precedence order?

Aucun commentaire:

Enregistrer un commentaire