Answer Posted / sumati
String is immutable
String buffer is mutable
Ex String str = "abc";
str = "new String";
this will creat new memory location and stores "new String"
but in String buffer
StringBuffer strBuf = "abc";
strBuf = "new String"
it will overwrite in same memory location
Is This Answer Correct ? | 13 Yes | 0 No |
Post New Answer View All Answers
What are white spaces in java?
What are the advantages of java over cpp?
What are thread safe functions?
Does java support Operator Overloading?
Explain where variables are created in memory?
How many bits is a string in java?
What is a wrapper method?
What are the different types of inner classes?
Difference between error and exception
What is the new line character?
What is the difference between equals() and == in java?
Can subclass overriding method declare an exception if parent class method doesn't throw an exception?
explain what is transient variable in java?
What does system out println () do?
Explain the importance of finally block in java?