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 multiple inheritance? Is it supported by java?

1011


How do you reverse a list?

1047


What does a boolean method return?

1299


How many bits is size_t?

1027


Explain the importance of join() method in thread class?

1133


Can a static method be final?

1106


What is derived datatype?

1264


Can a final method be overloaded?

996


Explain reverse a linked list iterative solution in java?

959


How hashmap increases its size in java?

1035


Can we override constructor?

1081


why are there separate wait and sleep methods? : Java thread

1076


What is a java predicate?

1014


Is java pass by value or pass by reference?

1027


How do you compare arrays in java?

996