Q:

When we mix strings and string or character literals, at least one operand to each + operator must be of string type

0

When we mix strings and string or character literals, at least one operand to each + operator must be of string type.

All Answers

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

string s4 = s1 + ", "; // ok: adding a string and a literal
string s5 = "hello" + ", "; // error: no string operand
string s6 = s1 + ", " + "world"; // ok: each + has a string operand
string s7 = "hello" + ", " + s2; // error: can't add string literals

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