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 treeset and treemap in java?
What is an example of a conditional statement?
Is linked list a linear or non-linear data structure?
What is jpa specification?
What are desktop procedures?
FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE BOTH IDS IN TWO LISTS,IF ID'S R SAME MEANS WE HAVE ADD THE DETAILS(LIKE NAME,PLACE) TO MAP...HOW IS POSSIBLE ?CAN ANY ONE SUGGEST?
What are three types of loops in java?
Is alive method in java?
what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread
Describe the process as to how substring() methodology mechanisms in java.
What is identifier in java?
Explain java coding standards for variables ?
Is linkedlist thread safe in java?
Can we declare a class as abstract without having any abstract method?
How do you add an arraylist to an array in java?