Home / Questions / Difference between length() and capacity() string functions?
Explanatory Question

Difference between length() and capacity() string functions?

👁 24 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

  • length() → number of characters present

  • capacity() → total allocated storage (StringBuffer)