I was looking at Java documentation and this example surprised me:
int height = new Rectangle().height;`
I always thought in such situation you have to use brackets:
int height = (new Rectangle()).height;
because operator precedence table shows that . operator have higher predecence than new operator, if so then why that line of code is executed like this:
int height = (new Rectangle()).height;
instead of being executed like this:
int height = new (Rectangle().height);