str1=”Good” str2=”Evening” Does the concatenation of the above two strings give back a new string or does it concatenate on the string str1? How do you prove your point?

Respuesta :

Answer:

It gives a new string

Explanation:

In programming; when two or more strings are concatenated by a concatenating operator, the result is always a new string.

From the question, we have that

str1 = "Good

str2 = "Evening"

Let's assume that + is the concatenating operator;

str1 + str2 = "Good" + "Evening" = "GoodEvening"

The result of concatenating str1 and str2 is a new string "GoodEvening" while str1 and str2 still maintain their original string value of "Good" and "Evening"