Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

operator precedence and associativity

 
Neil Laurance
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out this thread:
How you remember the operator precedence?
It refers to this thread:
Best Java Memory Aid Contest
Enjoy!
 
Sarma Lolla
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jessica,
The first link is not working. Can you please provide the correct link?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic