title: Difference between length() and capacity() methods in StringBuilder
body: <p>I was trying to figure out when to use or why <code>capacity()</code> method is different from <code>length()</code> method of <code>StringBuilder</code> or <code>StringBuffer</code> classes.</p>
  
  <p>I have searched on Stack Overflow and managed to come up with <a href="https://stackoverflow.com/questions/3184244/stringbuilder-capacity">this</a> answer, but I didn't understand its distinction with <code>length()</code> method. I have visited <a href="http://java.meritcampus.com/core-java-topics/java-stringbuffer-length-and-capacity-methods" rel="noreferrer">this</a> website also but this helped me even less.</p>