How to combine two StringBuilders in Java

1 Answer

0 votes
package javaapplication1;

import java.io.IOException;

public class JavaApplication1 {

    public static void main(String[] args) throws IOException {

        StringBuilder sb1 = new StringBuilder("java");
        StringBuilder sb2 = new StringBuilder(" c++");

        sb1.append(sb2);

        System.out.println(sb1);
    }
}


/*
                   
run:

java c++
          
 */

 



answered Dec 19, 2016 by avibootz
edited Jan 10, 2017 by avibootz

Related questions

1 answer 136 views
136 views asked Feb 9, 2017 by avibootz
1 answer 112 views
2 answers 253 views
1 answer 180 views
1 answer 205 views
1 answer 193 views
...