what is mutability?which one is mutable String or StringBuffer?and why?give
examples of each which shows the mutability of each String or StringBuffer

Answer Posted / surya simhadri

Mutability means which can be changed. StringBuffer is a
mutable bcoz the contents of the SB object we can change,
it can't create new reference location even though we
change the value it already referenced. But in case of
String it reference location is changed every time if u
change the content.

Is This Answer Correct ?    58 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is static variable with example?

570


What is the difference between a method and a function in alice?

583


Explain the difference between serializable and externalizable in java?

545


Can a static class have a constructor?

527


What is constructor and virtual function? Can we call a virtual function in a constructor?

685






How are variables stored?

533


What are the steps involved to create a bean?

685


What is a boolean used for?

593


What do you understand by abstract classes?

605


Explain super keyword in java.

588


write a program that list all permutations of ABCDEF in which A appears before B?

2015


Is empty in java?

586


What is module in oop?

572


How is it possible in java programming for two string objects with identical values not to be equal under the == operator?

572


How to split a string in java?

632