The ensureCapacity method ensures that the capacity is at least equal to the specified minimum. If the current capacity is less than the argument, then a new internal array is allocated with greater capacity. The new capacity is the larger of:
minimumCapacity argument is nonpositive, this method takes no action and simply returns.
StringBuffer Method:
StringBufferDemo2 CODE class StringBufferDemo2 OUTPUT Buffer = Java DESCRIPTION First the capacity of THINGS TO TRY
|