Answer Posted / sudheer babu
Both string and string buffer are different ,in the case of
the String it can ready only and immutable where as the
String Buffer is the modifier and mutable.
EX:
String s1="abc";
S.o.p(s1);---------->o/p is abc
StringBuffer sb=new StringBuffer("abc");
s.o.p(sb);---------->o/p is abc
here we can modify the String buffer values if we want i.e
sb.append("z");
s.o.p(sb);----------->0/p is abcz
"this is the basic difference between the String and String
Buffer."
| Is This Answer Correct ? | 8 Yes | 9 No |
Post New Answer View All Answers
Which interface does java.util.hashtable implement?
can u draw class/object diagram for ATM
Hi frnds how to lock an user when he enter wrong credentials more than 3 time using java or j2ee tech take username and password in a bean no need to connect DB and validate give me some sample application code or links its urgent for me thanks in advance
How is hashset maintained in memory by java ?
What are the considerations to be made in case of loops in java ?
What are the interfaces in java collections? : java collections
What is the use of hashcode in java ?
What are the main classes of the list interfaces? : java collections
Which server-side script takes the input from JavaScript, can access the database if it needs to, and processes the data.
What do you understand by synchronization? Why is it important?
What are the different types of classes implemented in the set interfaces? : java collections
HOW MUCH PERCENTAGE WE DEDUCT FOR OUR SUPPLIERS OR OTHER PROFESSIONALS
Which sorting algorithm is used by collections.sort() in java ?
What is java collection? : java collections
What is iterator in the java collections framework? : java collections