How do I concatenate two strings in Java?

前端 未结 23 3064
长情又很酷
长情又很酷 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

    Using "+" symbol u can concatenate strings.

    String a="I"; 
    String b="Love."; 
    String c="Java.";
    System.out.println(a+b+c);
    

提交回复
热议问题