What is the output of this code sequence? String s = "A" + "BC" + "DEF" + "GHIJ"; System.out.println( s );
1) A BC DEF GHIJ
2) ABCDEFGHIJ
3)s
4)abcdefghij
Solution
Explanation
+ operator is used to concatenate strings on either side
"A" + "BC" + "DEF" + "GHIJ"
is concatenated to
ABCDEFGHIJ
Testing with program
--
all the best
please upvote
Get Answers For Free
Most questions answered within 1 hours.