The way that java Strings work is: If you add a numeric variable to a String (with the + operator), the value of the numeric variable is converted to a String and the converted String's value is concatenated with the original String value to form a new single String.
And then...
If you add a String to a String (with the + operator), their values are concatenated to form a new single String.
Furthermore...
If you add a bunch of strings (with + operators), all of their values are concatenated to form a new single String.
Code java:
public class Z
{
public static void main(String [] args)
{
int x = 42;
System.out.println("The answer is " + x + ". Now what was the question?");
}
}
Output:
The answer is 42. Now what was the question?
Cheers!
Z