0% found this document useful (0 votes)
15 views5 pages

Concat

Uploaded by

Tamil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views5 pages

Concat

Uploaded by

Tamil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Click to add picture

JAVA programming
STRINGS
concat()
Definition

• The concat() method


appends(concatenate) a string to the
end of another string.
• It returns a combined string.
• It is like appending another string.
syntax
public String concat(String another
String)

EXAMPLE
public class ConcatExample2 {
public static void main(String[] args) {
String str1 = "Hello";
String str2 = "Javatpoint";
String str3 = "Reader";
String str4 = str1.concat(str2); // Concatenating one string
System.out.println(str4); // Concatenating multiple strings
String str5 = str1.concat(str2).concat(str3);
System.out.println(str5);
}
}
output

HelloJavatpoint
HelloJavatpointReader
Thank you
Presented by:
TAMILARASU A

You might also like