According to this table of Java operator precedence and associativity, member access has higher precedence than the new operator.
However, given a class myClass and a non-static member function myFunction, the following line of code is valid:
new myClass().myFunction();
If . is evaluated before new, how can this line be executed? In other words, why aren't parentheses required?
(new myClass()).myFunction();
My guess is that since () shares precedence with ., the myClass() is evaluated first, and so the compiler knows even before evaluating the new keyword that the myClass constructor with zero parameters is being called. However, this still seems to imply that the first line should be identical to new (myClass().myFunction());, which is not the case.