public class StringOp { public static void main( String args[] ) { int x1 = 1 , x2 = 2 , x3 = 3 ; String str1 = "Int Variables" ; String fName = "Archie " ; String lName = "Moore" ; //+ is the string concatenation operator //println converts the variables to integers System.out.println( str1 + x1 + x2 + x3 ) ; System.out.println( str1 + (x1 + x2 + x3) ) ; String str2 ; //StringOp.java:17: error: incompatible types: int cannot be converted to String // No automatic conversion // str2 = x1 ; str2 = Integer.toString( x1 ) ; //concatenate 2 strings using + String fullName = fName + lName ; System.out.println( fullName ) ; //Can use the += operator fullName += " Boxer" ; System.out.println( fullName ) ; } } //class