Concatenation in Java involves combining strings using the ‘+’ operator.
|
Note that we’ve included an empty string (” “) to insert a space between firstName and lastName when printing. |
Another method to concatenate two strings is by using the concat() method:
|