previous |
start |
next
Concatenation
- String fname = "Harry";
String lname = "Hacker";
String name = fname + lname;
- name is
"HarryHacker"
- If one operand of + is a string, the other is converted to a
string:
String a = "Agent";
String name = a + 7;
- name is
"Agent7"
previous |
start |
next