What is the difference between the capacity() and length()
functions in the stringbuffer class.
Answers
Answered by
0
Answer:
StringBuffer Method
Description
length(); Returns current length or number of characters stored inside StringBuffer object
capacity(); Returns current capacity i.e.; amount of storage space available for newly inserted characters
Note: beyond the limit, new allocation occurs and it is overhead
Similar questions