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
Explain the OOPS concept in Realtime Scenarion ? Take example as CAR. Please explain indetail ?
What is iterator in the java collections framework? : java collections
What is the Spring2.5 MVC Navigation flow?
What are the different types of classes implemented in the set interfaces? : java collections
What are maps interfaces in the java collections? : java collections
What are the different types of features of the java collections framework? : java collections
Which java collection class can be used to maintain the entries in the order in which they were last accessed?
How is hashset maintained in memory by java ?
What are the types of java collections? : java collections
What is an algorithm in java collection framework? : java collections
What is the difference between comparable and comparator in java.util pkg?
Which interface does java.util.hashtable implement?
What are the types of interface used in the java collections? : java collections
What do you understand by synchronization? Why is it important?
please mail me the interview question based on java/j2ee