Input: “Hello” and “World”
Input: “1234” and “5678”
Read Also : 5 Ways to Reverse a String in Java with Example
Points to Keep in Mind Before attempting the Solution :
1. String is immutable so once it is created in memory we will not be able to modify it rather than assigning new String. StringBuffer and StringBuilder are mutable, so once it is created , modifications can be done later.
2. The first argument of String.join() method is delimiter used to join strings and there can any number of string arguments starting from second argument.