✏️ Explanatory Question

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

👁 29 Views
📘 Detailed Answer
🟢 Easy
💡

Answer with Explanation

  • length() → number of characters present

  • capacity() → total allocated storage (StringBuffer)