In this section, you will learn how to combine or merge two strings in java. The java.lang package provides the method that helps you to combine two strings and making into single string. The following program is used for concatenating two string through using the concat() method that concatenates the specified string to the end of string and finally, you will get the combined string.
Description of code:
This is the method that concatenates the two specified strings.
Here is the code of program:
Output of program:
Enter First String:
Enter Second String:
Combin string example!
Combined string: RoseIndiaNewstrackIndia
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: June 8, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles