File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes operator precedence and associativity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "operator precedence and associativity" Watch "operator precedence and associativity" New topic

operator precedence and associativity

Neil Laurance
Ranch Hand

Joined: Jul 18, 2002
Posts: 183
I'm trying to find the exact operator precedence and associativity rules for Java. I found the following links online:
But the best source in my opinion is the table in the 'Java in a Nutshell' book by David Flanagan.
Anyways, Bruce Eckel's book contains the following mnemonic suggestion for remebering the precedence rules:
Ulcer - Unary
Addicts - Arithmetic
Really - Relational
Like - Logical
C - Conditional (ternary)
A Lot - Assignment
Does anyone know of other mnemonics for a more exact precedence AND associativity definition?
Thanks, Neil :roll:
Jessica Sant

Joined: Oct 17, 2001
Posts: 4313

Check out this thread:
How you remember the operator precedence?
It refers to this thread:
Best Java Memory Aid Contest

- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
Sarma Lolla
Ranch Hand

Joined: Oct 21, 2002
Posts: 203
The first link is not working. Can you please provide the correct link?
I agree. Here's the link:
subject: operator precedence and associativity
It's not a secret anymore!