0 votes 0 votes Please explain with some example that How Right to Left associativity takes place in case of Ternary operators? Sk Jamil Ahemad asked Feb 1, 2022 Sk Jamil Ahemad 328 views answer comment Share Follow See 1 comment See all 1 1 comment reply palashbehra5 commented Feb 2, 2022 reply Follow Share https://stackoverflow.com/questions/33939059/ternary-operator-as-both-left-operative-and-right-operative-or-neither 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes @Sk Jamil Ahemad Operators Associativity is used when two operators of same precedence appear in an expression…. Associativity can be either Left to Right or Right to Left… For example: ‘*’ and ‘/’ have same precedence and their associativity is Left to Right, so the expression “100 / 10 * 10” is treated as “(100 / 10) * 10”... 1. https://en.wikipedia.org/wiki/Operator_associativity 2. http://web.deu.edu.tr/doc/oreily/java/langref/ch04_14.htm aaa 1 answered Feb 2, 2022 aaa 1 comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Try to convert “?:” into if-else format first, once u have if-else format of your expression it will become obvious for you to understand why right to left associativity is there in case of “?:”. Udhay Brahmi answered Feb 8, 2022 Udhay Brahmi comment Share Follow See all 0 reply Please log in or register to add a comment.