328 views

2 Answers

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

 

 

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 “?:”.

Related questions

0 votes
0 votes
1 answer
3
Hardik Vagadia asked Jul 26, 2015
638 views
the number of bit strings of length 8 that will either start with 1 or end with 00 is?a) 32              b) 128              c) 160       ...
0 votes
0 votes
1 answer
4
Mak Indus asked Dec 17, 2018
302 views
Let a, b be two positive integers, which of the following options correctly relates / and %?(a) b= (a/b) * b + a%b (b) b= (...