Jesper de Jong wrote:What exactly is your question?
You can find a table that shows the precedence of operators in Oracle's Java Tutorials: Operators. As you can see in the table, % has the same precedence as multiplication * and division /. Expressions are evaluated from left to right, so if you have an expression with multiple operators that have the same precedence, then the one on the left will be evaluated first.
So a line such as: int1 % int2 * (int3 + int1) / int2
will be interpreted as: ((int1 % int2) * (int 3 + int1)) / int2
Note that you didn't tell us what the values of the variables int1, int2, int3 is so we can't explain you with those values what exactly happens.
Joanne Neal wrote:
A Ka wrote: Why I cannot use 2 public classes like below?
Because that's how Java was designed. All public top-level classes have to be in a file that matches the name of the class plus a .java extension.
So your two classes need to be in files called Hello.java and Welcomer.java.
Henry Wong wrote:
A Ka wrote:Core Java Fundamentals book by Horstman, page 48.
It is said that there is a difference between ++m and m++ but as you see the result below, both a=b=16.
How is wrong?
Did you noticed that in your example, you incremented m twice -- and didn't increment n at all? Do you think that it could be related to that? ... and BTW, sometimes, in order to see a difference, you have to try out more than one example.