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
How many decimal digits is 64 bit?
What is default exception handling in java?
When will you define a method as static in Java?
What is an interface in java?
What is the difference between math floor and math round?
What is class array in java?
What is a parameter in matrices?
Why does the integer quotient -0/3 yield 0, but the double quotient -0.0/3.0 yields – 0.0?
What are default methods ?
Why is java not 100% pure oops?
What is the implementation of destroy method in java. Is it native or java code?
Can static method access instance variables ?
What is hashmap in java?
How do you reverse a string in java without using string buffer?
What are byte codes?