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 deque in the java collections framework? : java collections
What are maps interfaces in the java collections? : java collections
What are the different types of classes implemented in the set interfaces? : java collections
What are the uses of the set interfaces in the java collections? : java collections
What is the enumerator of the java collection framework? : java collections
What are the main classes of the list interfaces? : java collections
What is the use of the list interface in the java collection? : java collections
What is an algorithm in java collection framework? : java collections
Which sorting algorithm is used by collections.sort() in java ?
What are the interfaces in java collections? : java collections
What are the different types of ways where you can iterate over a list? : java collections
Which interface does java.util.hashtable implement?
please mail me the interview question based on java/j2ee
What is the use of hashcode in java ?
What are the different types of collections views being provided by the map interface? : java collections