How to concatenate strings in Java
To concatenate strings we need to use plus
+ operator in Java.
In this below example, we are concatenating two strings by using
String first = "Code"; String last = "examples"; String combine = first + last; System.out.println(combine);
Similarly, you can also use the
concat() method to concatenate one string with another string.
String name = "Code"; System.out.println(name.concat("Java"));