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
What is size of int in java?
What does a boolean method return?
What are the various access specifiers in java?
Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?
What is a prefix function.write down a code to compute prefix function.
I want to persist data of objects for later use. What is the best approach to do so?
What if constructor is protected in java?
What is a Transient Object?
What is the difference between Java Program Constructor and Java Program Method, What is the purpose of Java Program constructor Please Explain it Breafily?
what do you understand by synchronization? : Java thread
What about main thread in java?
What are the differences between this and super keyword?
what is the swingutilities.invokelater(runnable) method for? : Java thread
What is vector?
Explain the reason behind ending a program with a system.exit(0)?