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
This abstract class is correct ? abstract class A { public abstract void Disp(); public abstract void B() { } public absract virtual C() { } }
How to call one constructor from the other constructor ?
Why java is said to be pass-by-value ?
Explain the difference between an Interface and an Abstract class?
What are predicates in java 8?
What is flush buffer?
How does sublist works in java?
What is hotjava?
Is Constructor possible in abstract class in java ?
What is the difference between && and & in java?
How to pass arraylist to stored procedure in java?
Explain about doubly linked list
What is the core java?
What is string and example?
Does java have a compiler?