To be honest, using common sense here should just work. Meaning, new instance of a class gets created, and then method gets invoked.
Not sure how that translates to precedence definition, but I don't think I'd find it very useful even if I were sure.
Prints:
Which is what I would expect.
I saw a lot of questions about the precedences in the past, but I never myself found a need to consult operators precedence table, I find it actually confusing.
i.e. let's say we have this code (traditional question of this kind):
Now, Oracle's documentation
here says, that postfix (expr++) and unary (++expr) have highest precedence among all, while multiplicative (*) and additive (+) have lower precedence that those earlier.
So now one can think to no end what that means looking to that expression shown earlier.
For me, all those precedences do not matter much (and I don't know them well), but I still can calculate easily what the result will be.
It is as simple as that, evaluating expression from left to right.
We start with:
a = 1
b = 1
a + b + ++a * b++
1. Initial value of a is 1, so we place its current value to expression and so we have:
2. b is 1, so we place its current value to expression and so we have:
3. ++a means increment its current value and then place it to expression and so we have:
4. b++ means place its current value to expression and then increment and so we have:
5. Now we have basic mathematics, multiplication first, then addition:
1 + 1 + 2 which turns to 2 + 2 and then to 4, because evaluating left to right
Now, I don't know, maybe that indeed is what those precedences imply from technical language standpoint, but I just simply never think about them and use some other means (which I just showed) to figure out