The string constructor should store a string that is being built somewhere. He does this in an array of characters. Capacity is the length of this array. As soon as the array is full, a new (longer) array will be allocated and the contents will be transferred to it. This increases throughput.
If you're not interested in performance, just ignore capacity. Capacity can become interesting when you are going to build huge lines and know your size in advance. You can then request a row builder with a capacity equal to the expected size (or a little more if you are not sure about the size).
An example when building a row with a content size of 1 million:
StringBuilder sb = new StringBuilder(1000000); for(int i = 0; i < 1000000; i++){ sb.append("x"); }
Initializing one million string builders will make it faster than the default string builder, which must copy its array again.
source share