This method returns a new String object which is the result of combining our String to that of the String method argument.
This example source code demonstrates the use of concat() method of String class. Basically this source code just prints the concatenated String of our parent String and our input String object.
For this example, we will be showing a practical scenario. First and foremost we will be reading our console for the student first name and last name. The Scanner class will be very useful on this scenario to read the console input from the user. We will be using the concat() method to get the full name by combining the first name and last name. This is an ideal practical scenario to demonstrate the use of this useful string method.