Java: String concatenation

This entry is part 6 of 54 in the series Learn Java

In Java, a string can be concatenated together using the + operator.

The following example will join 2 strings and a blank space.  The blank space is also a string.

package javaapplication5;

public class JavaApplication5 {

    public static void main(String[] args) {
        String a = "Every Picture Tells A Story";
        String b = "by Rod Stewart";
        String title = a + " " +  b;


Series Navigation<< Java: integer variables
Java: If else statement >>