at-m42:summary_of_operator_precedence_rules
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
at-m42:summary_of_operator_precedence_rules [2009/03/27 12:51] – eechris | at-m42:summary_of_operator_precedence_rules [2011/01/14 12:45] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | ====== Summary of Operator Precedence Rules ====== | ||
+ | |||
+ | These notes are extracted from Appendix C.3 of //Groovy Programming// | ||
+ | |||
+ | An expression involving operators of equal precedence is resolved by the // | ||
+ | <code groovy>2 + 3 * 4 + 5</ | ||
+ | |||
+ | If, in the expression '' | ||
+ | |||
+ | The full table of operator precedence and associativity for Groovy (and hence Java) is given in Table 1. | ||
+ | |||
+ | |||
+ | **Table 1** Operator Precedence and Associativity | ||
+ | |||
+ | ^ Category ^ Operators ^ Example ^ Associativity ^ | ||
+ | | Array subscript | '' | ||
+ | | Member access | '' | ||
+ | | Post-fix unary operators | '' | ||
+ | | (Pre-fix) unary operators | '' | ||
+ | | Multiplicative | '' | ||
+ | | Additive | '' | ||
+ | | Shift| '' | ||
+ | | Relational | ''< | ||
+ | | Equality | '' | ||
+ | | Bitwise And | ''&'' | ||
+ | | Bitwise exclusive Or | '' | ||
+ | | Bitwise inclusive Or | '' | ||
+ | | Logical And | ''&&'' | ||
+ | | Logical Or | '' | ||
+ | | Conditional | '':?'' | ||
+ | | Assignment | '' | ||
+ | | | '' | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | [[Home]] | [[Lectures]] | ||
at-m42/summary_of_operator_precedence_rules.txt · Last modified: 2011/01/14 12:45 by 127.0.0.1