Languages
[Edit]
EN

Java - String concat() method example

0 points
Created by:
Lennie-S
439

In this article, we would like to show you how to concatenate two strings using concat() method in Java.

Quick solution:

 

1. Documentation

Edit
Syntaxpublic String concat(String str)
Parametersstr - the String to be concatenated to the end of this String.
ResultReturns a String representing the text of the combined strings.
Description

The method concatenates a string to the end of another string.

2. Practical example

Edit

In this example, we will concatenate string2 to the end of string1.

Output:

Related posts

Edit

Alternative titles

  1. Java - concatenate strings
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Java - String documentation

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join