Specifications

Sun Services
Java™ Programming Language
Module 4, slide 15 of 31
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
String Concatenation With +
The + operator works as follows:
Performs String concatenation
Produces a new String:
String salutation = "Dr.";
String name = "Pete" + " " + "Seymour";
String title = salutation + " " + name;
One argument must be a String object.
Non-strings are converted to String objects
automatically.