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...

what is the main difference between string and stringbuffer?
can you explain it with program?

Answer Posted / divya

String class is used to manipulate character strings that
cannot be changed.Simply stated,objects of the String are
read only and immutable.

StringBuffer class is used to represent characters that can
be modified.

Ex:Sting str=new String("core");
str +="Java";

StringBuffer str=new StringBuffer("core");
str.append("Java");

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by interface?

1105


What is a modifier?

1599


Is overriding possible in java?

1006


Explain about main() method in java ?

1117


What's a method in programming?

1157


What is difference between == equals () and compareto () method?

1098


What is a short in java?

1121


Can a private method be declared as static?

1066


Difference between this() and super() in java ?

1142


What is the advantage of preparedstatement over statement?

1166


What is space character in java?

1174


What is the purpose of encapsulation?

1056


What is the memory leak in java?

1101


What invokes a thread's run() method in java programming?

1272


Can java arraylist hold different types?

1152