Java Tricky Program 10 - operator precedence

preview_player
Показать описание
When an equation is evaluated in java, it's done from left to right. But operator precedence is given before evaluation. For example, if there are multiplications involved then they are evaluated before addition or subtraction.
Also java arithmetic behaves like normal math, so + and + will become +. - - will become + and - + will become -.
Рекомендации по теме
Комментарии
Автор

I got a quick question: why in this String ##String s = does 4+5 addition is not happening; as 4 is not a string nor is 5 they are ints. Shouldn't they be added together?

allawadiarvind