How do I concatenate two strings in Java?

前端 未结 23 3400
长情又很酷
长情又很酷 2020-11-22 04:47

I am trying to concatenate strings in Java. Why isn\'t this working?

public class StackOverflowTest {  
    public static void main(String args[]) {
                


        
23条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-22 05:09

    For better performance use str1.concat(str2) where str1 and str2 are string variables.

提交回复
热议问题