Use the below code to concatenate Strings using the + operator:
System.out.println("Your number is " + theNumber + "!");
When you run this, theNumber is implicitly converted to the String "42".
Interested in Java? Check out this Java tutorial by Intellipaat.