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 static variable with example?
What is the difference between a method and a function in alice?
Explain the difference between serializable and externalizable in java?
Can a static class have a constructor?
What is constructor and virtual function? Can we call a virtual function in a constructor?
How are variables stored?
What are the steps involved to create a bean?
What is a boolean used for?
What do you understand by abstract classes?
Explain super keyword in java.
write a program that list all permutations of ABCDEF in which A appears before B?
Is empty in java?
What is module in oop?
How is it possible in java programming for two string objects with identical values not to be equal under the == operator?
How to split a string in java?