IT/Android
[KOTLIN] 연산자 우선순위 (operator precedence)
ttoogi
2023. 2. 17. 12:22
Expressions
Precedence | Title | Symbols |
Highest | Postfix | ++, --, ., ?., ? |
Prefix | -, +, ++, --, !, label | |
Type RHS | :, as, as? | |
Multiplicative | *, /, % | |
Additive | +, - | |
Range | .. | |
Infix function | simpleIdentifier | |
Elvis | ?: | |
Named checks | in, !in, is, !is | |
Comparison | <, >, <=, >= | |
Equality | ==, !=, ===, !== | |
Conjunction | && | |
Disjunction | || | |
Spread operator | * | |
Lowest | Assignment | =, +=, -=, *=, /=, %= |
참고
https://kotlinlang.org/docs/reference/grammar.html#precedence