File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

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:
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/expressions.html
http://www.sorcon.com/java2/precedence.htm
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
Sheriff

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
Enjoy!


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

Joined: Oct 21, 2002
Posts: 203
Jessica,
The first link is not working. Can you please provide the correct link?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: operator precedence and associativity