So let me know how is java compilers solving these expression.
Java compiler are simply implementing the Java Language Specification.
If you really need to understand how compiler evaluates horrible and bizarre statements like that, you need to understand the relevant parts of the spec:
- 15.7 Evaluation Order
- 15.14.2 Postfix Increment Operator ++
- 15.15.1 Prefix Increment Operator ++
and so on.