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 bytes is a string java?
What is meant by singleton class?
What is subsequence of a string?
what is mena by object block any what is the use of that
What is the meaning of immutable regarding string?
Can we call virtual funciton in a constructor ?
What is difference between == and === in js?
What do you mean by inner class in java? Explain
What is the purpose of nested class in java?
What is the purpose of stub and skeleton?
What are the different access modifiers available in java?
What is a variable simple definition?
what is object slice?
Write a program to check for a prime number in java?
Is hashset sorted in java?