Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how do you combine 2 strings in java

-By  using (+) operator
-By  using concatenate method (concat()).
                      String strconcat3=strconcat2.concat(strconcat);

-By StringBuffer
-String strconcat= new StringBuilder().append("matt")
                                .append("damon").toString();
                                
-By StringBuilder
- String strconcat2= new StringBuffer()
                  .append("matt").append("damon").toString();
Source by www.javatpoint.com #
 
PREVIOUS NEXT
Tagged: #combine #strings #java
ADD COMMENT
Topic
Name
8+5 =