The StringBuffer class is used to created mutable string.The StringBuffer class is same as string except. It is mutable.
Counstructor:-
StringBuffer();
StringBuffer(String str);
StringBuffer(int capacity);
Example:-
class A{
public static void main(String args[]){
StringBuffer buffer = new StringBuffer("Hello");
buffer.append("Java");
System.out.println(sb);
}
}
Counstructor:-
StringBuffer();
StringBuffer(String str);
StringBuffer(int capacity);
Example:-
class A{
public static void main(String args[]){
StringBuffer buffer = new StringBuffer("Hello");
buffer.append("Java");
System.out.println(sb);
}
}
No comments:
Post a Comment