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
Is there any sort function in java?
what is the significance of listiterator in java?
Explain the reason behind ending a program with a system.exit(0)?
Where is core java used?
Is oracle java 11 free?
What are the methods of object class ?
What is string subsequence method?
Can we make a constructor final?
When will you define a method as static?
Give me an example of array and linked list? Where they can be used?
Write a java program for binary search?
How to declare objects of a class ?
Write the algorithm to check the number non-leaf nodes in a tree.
What is the difference between serializable and externalizable interface?
Why are variables important in research?