Advertisements
Advertisements
प्रश्न
Evaluate the following expression as per Java priority & associativity.
6 * 2 / 4
मूल्यांकन
Advertisements
उत्तर
Priority (Precedence): Both multiplication (*) and division (/) have the same precedence level in Java.
Associativity: Since their precedence is equal, Java evaluates them from left to right.
- First, evaluate the left-most operation: 6 * 2 = 12
- Next, evaluate the remaining operation: 12 / 4 = 3
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
