To resolve this example
you should know operator precedence, check
here. Because x-- have the highest precedence among the given operators it will be evaluated first, then x/0 and then - so the expression
x---x/0 will be:
x-- - x/0
In the example:
int x=8;
System.out.println("x value:"+(x---x/2));
the result is 5 because you have to remember that x-- is a postfix operator and it is applied after the whole expression is evaluated.