Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Difference between String & StringBuffer

Answer Posted / nilesh bhil( mca) amravati

String is immutable.
It means that we cant change the content of String once created. If we try append a new string using + operator
then it creates new String object.
ex.
string s = new String("Java");
s = s + "bean" ;// this statement creates new object.
String class does not have method that append new String to old String in object.


where as StringBuffer class is mutable. It means that we can add new String to it using append() method.
ex.
StringBuffer sb = new StringBuffer("Java");
sb.append("Bean");

Is This Answer Correct ?    38 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is return data type?

1016


What are the steps involved to create a bean?

1172


What is the purpose of return statement?

1070


What is the difference between length and length () in java?

956


Why is whitespace important?

1088


What is methodological theory?

1007


Does isempty check for null?

1027


How to sort an array in java without using sort method?

885


Explain java heap space and garbage collection?

1085


Can a source file contain more than one class declaration?

1015


Explain the public class modifier?

966


What is private public protected in java?

1047


What should I import for arraylist in java?

1054


Explain about collection interface in java?

997


Explain the difference between protected and default access.

1011