The + operator combines two strings into a new string
public static String combine(String s1, String s2) {
String result = s1 + s2;
return result;
}
| Function Call | Return Value | |||
|---|---|---|---|---|
| combine("Car", "wash") | → | |||
| combine("Hello", " world") | → | |||
| combine("5", "8") | → | |||
| combine("Snow", "ball") | → | |||
| combine("Rain", "boots") | → | |||
| combine("Reading", "bat") | → | |||
| combine("AAA", "Hi") | → | |||
| combine("Hi", "there") | → | |||
| combine(" ", " ") | → | |||
Experiment with this code on Gitpod.io