Try this code to see what is happening and see my explanation below. Hope this helps!
The call to line.concat("world") returns a String object which isn't caught and the contents of line doesn't change. So, after line.concat ("world"), line still has the contents " hello ". That's a white space, the
word "hello" and two more white spaces for a total of 8 characters. So line has length 8 and newLine removes the white space so it has length 8 - 3 white space characters or 5. 8 + 5 = 13. The bottom line here is that the concat() method returns a new String object...