I have the following example code:
int pay = 80;
int bonus = 65;
System.out.println(pay + bonus + \" \" + bonus + pay);
could someone please ex
Your code is interpreting the expression from left to right.
pay + bonus is interpreted as a mathematical function, so it adds the values to make 145. The + here is a plus operator." ", Java converts the expression into a String. The + here is a concatenate operator.+ pay converts pay to a String and concatenates it, because the expression is a String.+ bonus converts bonus to a String and concatenates it, also because of the previous expression.