394,237 views
41 votes
41 votes
Look at the following assignment statements:

word1 = "rain"
word2 = "bow"

What is the correct way to concatenate the strings?

1 newWord = word1 == word2

2 newWord = word1 + word2

3 newWord = word1 * word2

4 newWord = word1 - word2

User Yaz
by
2.7k points

2 Answers

20 votes
20 votes

Answer:

2 newWord = word1 + word2

Step-by-step explanation:

User Rinkert
by
2.4k points
29 votes
29 votes

Answer: number 2 is the correct way to do it

Step-by-step explanation:

User Andras Dosztal
by
3.4k points