How to append a string to StringBuilder in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
        StringBuilder sb = new StringBuilder("Java");  

        sb.append(" Programming");
        
        System.out.println(sb);
    }
}



/*
run:

Java Programming

*/

 



answered Jun 16, 2019 by avibootz
edited Jun 16, 2019 by avibootz

Related questions

...