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 is meant by encapsulation?
Can we create constructor in abstract class ?
Can we override private constructor in java?
What programs use java?
What is java in simple terms?
Explain reverse a linked list iterative solution in java?
What is a generic data type?
What is tree node in java?
What is data type in java?
When do we need to use internal iteration? When do we need to use external iteration?
How does system arraycopy work in java?
What are basic data types?
how to deploy tomcatserver to weblogic server? write d following steps?
What is ‘has a’’ relationship in java?
What is meant by method overriding?