JAVA(String Buffer and String Builder

 package String;


public class StringTest {

public static void main(String[] args) {

/*

* Example of immutable string

* Immutable means unchangeable7

* Example of string buffer  

*/

String s="I teach in ";

s.concat("Arniko school");

System.out.println(s);

//to solve this problem we have string builder

StringBuilder sb= new StringBuilder("I teach in ");

sb.append("Arniko school ");

System.out.println(sb);

}


}


Comments

Popular posts from this blog

Java Swing Complete examples step by step(make a project with swing)

Java Program to find average of Three numbers

Java Program any letter to upper case Letter(JavaSWING) ActionListener