Difference between String & StringBuffer
Answer Posted / srikanth reddy
-->String objects are constants and immutable where as
StringBuffer objects are mutable
-----------------------------------------
-->in string class we can create object by two ways
1)using new operator --> string s = new String("Java");
2)without new operator --> String s2="raju";
------------------------------------------
-->in string class there string constant pooling technique
but in stringbuffer there is no facility
-------------------------------------------
all the methods in stringbuufer class is synchorined so
thread safe but not in string class
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How many ways can an argument be passed to a subroutine and explain them?
What does int argc char * argv [] mean?
What is constant in programming?
What is difference between string and new string?
Can string be considered as a keyword?
What is the difference between conversation & casting?
why using interface interface ?
What are the advantages of autoboxing?
What is a boolean in java?
What is package protected in java?
Define class?
Why is string builder not thread safe?
What is boolean query?
Is nullpointerexception checked or unchecked?
What is the difference between JDK and JVM?