Java: Concatenate a given string to the end of another string
7. Concatenate Two Strings
Write a Java program to concatenate a given string to the end of another string.
Visual Presentation:
Sample Solution:
Java Code:
Sample Output:
String 1: PHP Exercises and String 2: Python Exercises The concatenated string: PHP Exercises and Python Exercises
Flowchart:
For more Practice: Solve these Related Problems:
- Write a Java program to concatenate two strings and then intersperse a delimiter between their characters.
- Write a Java program to join three user-input strings into one, ensuring proper spacing and punctuation.
- Write a Java program to merge two strings character by character, concatenating them into a new string.
- Write a Java program to concatenate two strings and then reverse the resulting string.
Go to:
PREV : Case-Insensitive String Comparison.
NEXT : Contains Specified Sequence.
Java Code Editor:
Improve this sample solution and post your code through Disqus
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.