






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







a = hello b = goodbyehello c = goodbye Note: When we execute the line b = b.concat(a), the method call creates a new String object which stores "goodbyehello" and then the reference b is set to point to that object. b moves from previously pointing at the String object storing "goodbye". However, c is STILL referring to the String object storing "goodbye".
7 = 7 This statement is read left to right. If both operands to a plus sign are integers, then addition is carried out, thus 3 + 4 evaluates to 7. Then, when we calculate 7 + " = 7", since the second operand is a String, we do String concatenation.