Computer Science, asked by jyotikaDass, 5 months ago

What is the difference between the capacity() and length()

functions in the stringbuffer class. ​

Answers

Answered by agnesfernandes879
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