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
What is the use of the list interface in the java collection? : java collections
What are the types of the main implementing classes in the map interfaces? : java collections
can u draw class/object diagram for ATM
Which server-side script takes the input from JavaScript, can access the database if it needs to, and processes the data.
What are the queues in the java collection framework? : java collections
What are the uses of the set interfaces in the java collections? : java collections
Hi we have an urgent requirement for Java/J2ee technical lead position & also looking for "Java Guidewire claimcentre" experienced professional for Bangalore location if interested can reach srisanh@gmail.com
What is java collection? : java collections
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
What is the use of hashcode in java ?
What is deque in the java collections framework? : java collections
What are maps interfaces in the java collections? : java collections
What do you understand by synchronization? Why is it important?
How is hashset maintained in memory by java ?
Which sorting algorithm is used by collections.sort() in java ?