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
What does .equals do in java?
What is field name?
Why put method is used?
How are destructors defined in java?
Difference between object and reference?
What are meta-annotations?
What is a map in java?
Does java trim remove newline?
How to read and write image from a file ?
What is finally block?
whatis Home interface and Remoteinterface? with example?
What are the differences between graph and tree?
What are reference variables in java?
What are advantages of exception handling in java?
How many types of the indexof method are there for strings?