0

Thread for (my) challenges

Locating my or quizzes' authors' mistakes. edit: Should've tested on my own, but still [ANSWERED] { can we write so String s1 = "sth" +1; Seems that int and String are incompatible.}

30th Mar 2017, 8:52 PM
Alex Snaidars
Alex Snaidars - avatar
2 Answers
+ 16
Yes, it's allowed in Java. The value of s1 will be sth1. You can check it here : https://code.sololearn.com/cIDsUE4bu85L/?ref=app For more details on concatenation, view this post : https://www.sololearn.com/discuss/257539/?ref=app
30th Mar 2017, 9:08 PM
Shamima Yasmin
Shamima Yasmin - avatar
+ 1
The + operator is implemented with the StringBuilder's append method. The append method is overloaded to allow appending many different types. Therefore, you can plus float, int, char and a few others.
30th Mar 2017, 9:16 PM
Jehad Al-Ansari
Jehad Al-Ansari - avatar