How to use java to concatenate strings
This article mainly explains "how to use java stitching string", the content of the article is simple and clear, easy to learn and understand, now please follow the editor's train of thought slowly in depth, together to study and learn "how to use java splicing string" bar!
1. The Java language allows you to concatenate (concatenate) two strings with a + sign.
2. When you concatenate a string with the value of a non-empty string, the latter is converted to a string (any Java object can be converted into a string).
Example
Int age = 13String rating = "PG" + age; / / set rating to "PG13" / / use the static join method to put multiple strings together / / and specify a delimiter to separate String all = String.join ("/", "S", "M", "L", "XL"); / / the value of S/M/L/XL / / repeated is javajavajavaString repeated = "java" .repeat (3) Thank you for your reading, the above is the content of "how to use java to assemble strings". After the study of this article, I believe you have a deeper understanding of how to use java to stitch strings, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!