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
Why hashcode is used in java?
When will we use them?
Can we use different return types for methods when overridden?
Is empty in java?
What does indexof return in java?
What is a control variable example?
What are invisible components?.
List out benefits of object oriented programming language?
Is java call by reference?
Compare Mutex and Semaphore in java.
Explain oops concepts in detail?
Explain purpose of sleep() method in java?
What is argument in java?
What is unicode datatype?
What are predicates in java 8?