Q:

Java Program to concatenate a given string to the end of another string

0

Program to concatenate a given string to the end of another string.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

public class demo1 
{
    public static void main(String[] args)
    {
        String str1 = "Hello! ";
        String str2 = "How Are you.";
        
        System.out.println("String 1: " + str1);
        System.out.println("String 2: " + str2); 
               
        String str3 = str1.concat(str2);        
        System.out.println("The concatenated string: " + str3);
    }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now