Please enable JavaScript.
Coggle requires JavaScript to display documents.
Chapter 2 (Operator Precedence (Relational Operators <, >, <=,…
Chapter 2
Operator Precedence
Relational Operators <, >, <=, >=, instanceof
Equal to/not equal to(==, !=)
Shift(<<, >>, >>>)
Logical Operator(&, ^, |)
Add/Sub(+, -)
Short-circuit logical operator(&&, ||)
Multiplication/Div/Mod(*, /, %)
Ternary Operators(exp ? true : false)
Other Unary(+, -, !)
Assignment Operators (=, +=, -=, *=, /=, %=, &=, ^=, !=, <<=, >>=, >>>=)
Pre-Unary(++expression, --expression)
Post-Unary(expression++, expression--)
unary operators, auto casts a value
exp. int x = 1; long y = 13l; x += y;
this would first case int to long then add them. After that cast it back to int
assignments returns a value
int x = 1; int y = (x = 1); x would equal to 1 and y would equal to 1
numeric auto promotes to the larger data type
when an arithmetic operation is used